Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed that you can now pass an alternative :href option to link_to_fu…

…nction/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
  • Loading branch information...
commit bceb88ef9c402a722caa7441a53f768aa14ab709 1 parent 7669011
@dhh dhh authored
View
2  actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* 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]
+
* Added Request#xml_http_request? (and an alias xhr?) to that'll return true when the request came from one of the Javascript helper methods (Ajax). This can be used to give one behavior for modern browsers supporting Ajax, another to old browsers #1127 [Sam Stephenson]
* Added assert_tag and assert_no_tag as a much improved alternative to the deprecated assert_template_xpath_match #1126 [Jamis Buck]
View
6 actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -29,7 +29,7 @@ module JavascriptHelper
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 @@ def periodically_call_remote(options = {})
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)'
Please sign in to comment.
Something went wrong with that request. Please try again.