diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-08-29 07:48:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-08-29 07:48:55 +0000 |
commit | 06a731e365011715759f46a09cb726b9f0350d00 (patch) | |
tree | 17306e05e1aae3af3442fd98fcd3e0335d5eb6e4 /actionpack | |
parent | 68c9c931182d92ff0460b6e8ce9656d174b71619 (diff) | |
download | rails-06a731e365011715759f46a09cb726b9f0350d00.tar.gz rails-06a731e365011715759f46a09cb726b9f0350d00.tar.bz2 rails-06a731e365011715759f46a09cb726b9f0350d00.zip |
Keep onsubmit around for form_remote_for
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4838 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 115b70d7b0..1b915882c6 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -169,7 +169,9 @@ module ActionView options[:form] = true options[:html] ||= {} - options[:html][:onsubmit] = "#{remote_function(options)}; return false;" + options[:html][:onsubmit] = + (options[:html][:onsubmit] ? options[:html][:onsubmit] + "; " : "") + + "#{remote_function(options)}; return false;" form_tag(options[:html].delete(:action) || url_for(options[:url]), options[:html]) end @@ -293,7 +295,7 @@ module ActionView javascript_options = options_for_ajax(options) update = '' - if options[:update] and options[:update].is_a?Hash + if options[:update] && options[:update].is_a?(Hash) update = [] update << "success:'#{options[:update][:success]}'" if options[:update][:success] update << "failure:'#{options[:update][:failure]}'" if options[:update][:failure] @@ -307,7 +309,7 @@ module ActionView "new Ajax.Updater(#{update}, " url_options = options[:url] - url_options = url_options.merge(:escape => false) if url_options.is_a? Hash + url_options = url_options.merge(:escape => false) if url_options.is_a?(Hash) function << "'#{url_for(url_options)}'" function << ", #{javascript_options})" |