aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-18 05:15:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-18 05:15:17 +0000
commitbceb88ef9c402a722caa7441a53f768aa14ab709 (patch)
tree677654bd1e536b5ec52cc7fc7b8c8836da0bac18 /actionpack/lib/action_view
parent76690111d52dca6c1992ff6c9f9962c889b40c5d (diff)
downloadrails-bceb88ef9c402a722caa7441a53f768aa14ab709.tar.gz
rails-bceb88ef9c402a722caa7441a53f768aa14ab709.tar.bz2
rails-bceb88ef9c402a722caa7441a53f768aa14ab709.zip
Fixed that you can now pass an alternative :href option to link_to_function/remote in order to point to somewhere other than # if the javascript fails or is turned off. You can do the same with form_remote_tag by passing in :action. #1113 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1200 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/javascript_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb
index 7e11e09c1d..35a09b2e4e 100644
--- a/actionpack/lib/action_view/helpers/javascript_helper.rb
+++ b/actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -29,7 +29,7 @@ module ActionView
def link_to_function(name, function, html_options = {})
content_tag(
"a", name,
- html_options.symbolize_keys.merge(:href => "#", :onclick => "#{function}; return false;")
+ {:href => "#", :onclick => "#{function}; return false;"}.merge(html_options.symbolize_keys)
)
end
@@ -87,13 +87,13 @@ module ActionView
def form_remote_tag(options = {})
options[:form] = true
- options[:html] ||= { }
+ options[:html] ||= {}
options[:html][:onsubmit] = "#{remote_function(options)}; return false;"
tag("form", options[:html], true)
end
- # Returns a button input tag that will submit form using XMLHttpRequest in tghe background instead of regular
+ # Returns a button input tag that will submit form using XMLHttpRequest in the background instead of regular
# reloading POST arrangement. <tt>options</tt> argument is the same as in <tt>form_remote_tag</tt>
def submit_to_remote(name, value, options = {})
options[:with] = 'Form.serialize(this.form)'