diff options
author | Bob Remeika <bob.remeika@gmail.com> | 2009-11-04 23:18:15 -0800 |
---|---|---|
committer | Stefan Penner <stefan.penner@gmail.com> | 2010-01-27 12:44:31 -0600 |
commit | 7d34975214e80d54786f92cf1daee7ec7847a07c (patch) | |
tree | 7d856210cb7fcf4d14878b170aaaa37094840306 /actionpack/lib | |
parent | 39ec7ce6a93945bc97f599d8cb503711a66f3952 (diff) | |
download | rails-7d34975214e80d54786f92cf1daee7ec7847a07c.tar.gz rails-7d34975214e80d54786f92cf1daee7ec7847a07c.tar.bz2 rails-7d34975214e80d54786f92cf1daee7ec7847a07c.zip |
Added submit_to_remote helper
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 9f1ca138eb..1a75f9372b 100644 --- a/actionpack/lib/action_view/helpers/ajax_helper.rb +++ b/actionpack/lib/action_view/helpers/ajax_helper.rb @@ -48,6 +48,16 @@ module ActionView tag(:input, attributes) end + def submit_to_remote(name, value, options = {}) + html_options = options.delete(:html) || {} + html_options.merge!(:name => name, :value => value, :type => "submit") + + attributes = extract_remote_attributes!(options) + attributes.merge!(html_options) + + tag(:input, attributes) + end + def periodically_call_remote(options = {}) attributes = extract_observer_attributes!(options) attributes["data-js-type"] = "periodical_executer" |