Skip to content
This repository
Browse code

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
David Heinemeier Hansson authored April 18, 2005
2  actionpack/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* 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]
  4
+
3 5
 * 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]
4 6
 
5 7
 * Added assert_tag and assert_no_tag as a much improved alternative to the deprecated assert_template_xpath_match #1126 [Jamis Buck]
6  actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -29,7 +29,7 @@ module JavascriptHelper
29 29
       def link_to_function(name, function, html_options = {})
30 30
         content_tag(
31 31
           "a", name, 
32  
-          html_options.symbolize_keys.merge(:href => "#", :onclick => "#{function}; return false;")
  32
+          {:href => "#", :onclick => "#{function}; return false;"}.merge(html_options.symbolize_keys)
33 33
         )
34 34
       end
35 35
 
@@ -87,13 +87,13 @@ def periodically_call_remote(options = {})
87 87
       def form_remote_tag(options = {})
88 88
         options[:form] = true
89 89
 
90  
-        options[:html] ||= { }
  90
+        options[:html] ||= {}
91 91
         options[:html][:onsubmit] = "#{remote_function(options)}; return false;"
92 92
 
93 93
         tag("form", options[:html], true)
94 94
       end
95 95
       
96  
-      # Returns a button input tag that will submit form using XMLHttpRequest in tghe background instead of regular
  96
+      # Returns a button input tag that will submit form using XMLHttpRequest in the background instead of regular
97 97
       # reloading POST arrangement. <tt>options</tt> argument is the same as in <tt>form_remote_tag</tt>
98 98
       def submit_to_remote(name, value, options = {})
99 99
         options[:with] = 'Form.serialize(this.form)'

0 notes on commit bceb88e

Please sign in to comment.
Something went wrong with that request. Please try again.