aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorErik St. Martin <alakriti@gmail.com>2010-01-26 16:20:25 -0500
committerStefan Penner <stefan.penner@gmail.com>2010-01-27 12:44:35 -0600
commit3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6 (patch)
treeb9b501e2913ec16433b90c779bd94b43cd726a66 /actionpack
parent5584d58e656c5c09db20d15727d9387ed39f8cf2 (diff)
downloadrails-3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6.tar.gz
rails-3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6.tar.bz2
rails-3c7d39d65f6ad55543cd2d12aec22dd8f927f1c6.zip
observe_form now supports :with option as it should
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)