diff options
author | Erik St. Martin <alakriti@gmail.com> | 2010-01-26 16:20:25 -0500 |
---|---|---|
committer | Stefan Penner <stefan.penner@gmail.com> | 2010-01-27 12:44:35 -0600 |
commit | 3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6 (patch) | |
tree | b9b501e2913ec16433b90c779bd94b43cd726a66 /actionpack/lib | |
parent | 5584d58e656c5c09db20d15727d9387ed39f8cf2 (diff) | |
download | rails-3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6.tar.gz rails-3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6.tar.bz2 rails-3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6.zip |
observe_form now supports :with option as it should
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/ajax_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/ajax_helper.rb b/actionpack/lib/action_view/helpers/ajax_helper.rb index 2ef791b834..343bd78bbd 100644 --- a/actionpack/lib/action_view/helpers/ajax_helper.rb +++ b/actionpack/lib/action_view/helpers/ajax_helper.rb @@ -496,8 +496,11 @@ module ActionView # +observe_field+. The JavaScript variable +value+ available to the # <tt>:with</tt> option is set to the serialized form by default. def observe_form(name, options = {}) + html_options = options.delete(:callbacks) + options[:observed] = name attributes = extract_observer_attributes!(options) + attributes.merge!(html_options) if html_options script_decorator(attributes).html_safe! end @@ -609,6 +612,13 @@ module ActionView options.merge!(:callbacks => html) super end + + def observe_form(name, options = {}) + html = {} + set_with_and_condition_attributes(options, html) + options.merge!(:callbacks => html) + super + end private def set_callbacks(options, html) |