aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/ajax_helper.rb10
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)