public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Changed PrototypeHelper#submit_to_remote to PrototypeHelper#button_to_remote to 
stay consistent with link_to_remote (submit_to_remote still works as an alias) 
(clemens) [#8994 status:closed]
dhh (author)
Wed Jul 09 07:13:24 -0700 2008
commit  6b61e95dc8d717b4500ab623816863c0bb707e2b
tree    24c6a89bdecc107bb639665792e1e290c1563277
parent  84af99e78dbf65b7faa92313acf8457cb0c2b510
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *Edge*
0
 
0
+* Changed PrototypeHelper#submit_to_remote to PrototypeHelper#button_to_remote to stay consistent with link_to_remote (submit_to_remote still works as an alias) #8994 [clemens]
0
+
0
 * Add :recursive option to javascript_include_tag and stylesheet_link_tag to be used along with :all. #480 [Damian Janowski]
0
 
0
 * Disable the Accept header by default [Michael Koziarski]
...
397
398
399
400
 
401
402
403
...
405
406
407
408
 
409
410
411
412
 
 
 
413
414
415
...
420
421
422
 
423
424
425
...
397
398
399
 
400
401
402
403
...
405
406
407
 
408
409
410
411
 
412
413
414
415
416
417
...
422
423
424
425
426
427
428
0
@@ -397,7 +397,7 @@ module ActionView
0
       #  # Generates: <input name="create_btn" onclick="new Ajax.Request('/testing/create', 
0
       #  #     {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)}); 
0
       #  #     return false;" type="button" value="Create" />
0
-      #  <%= submit_to_remote 'create_btn', 'Create', :url => { :action => 'create' } %>
0
+      #  <%= button_to_remote 'create_btn', 'Create', :url => { :action => 'create' } %>
0
       #
0
       #  # Submit to the remote action update and update the DIV succeed or fail based
0
       #  # on the success or failure of the request
0
@@ -405,11 +405,13 @@ module ActionView
0
       #  # Generates: <input name="update_btn" onclick="new Ajax.Updater({success:'succeed',failure:'fail'}, 
0
       #  #      '/testing/update', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)}); 
0
       #  #      return false;" type="button" value="Update" />
0
-      #  <%= submit_to_remote 'update_btn', 'Update', :url => { :action => 'update' },
0
+      #  <%= button_to_remote 'update_btn', 'Update', :url => { :action => 'update' },
0
       #     :update => { :success => "succeed", :failure => "fail" }
0
       #
0
       # <tt>options</tt> argument is the same as in form_remote_tag.
0
-      def submit_to_remote(name, value, options = {})
0
+      #
0
+      # Note: This method used to be called submit_to_remote, but that's now just an alias for button_to_remote
0
+      def button_to_remote(name, value, options = {})
0
         options[:with] ||= 'Form.serialize(this.form)'
0
 
0
         options[:html] ||= {}
0
@@ -420,6 +422,7 @@ module ActionView
0
 
0
         tag("input", options[:html], false)
0
       end
0
+      alias_method :submit_to_remote, :button_to_remote
0
       
0
       # Returns '<tt>eval(request.responseText)</tt>' which is the JavaScript function
0
       # that +form_remote_tag+ can call in <tt>:complete</tt> to evaluate a multiple
...
201
202
203
204
 
205
206
 
207
208
209
...
201
202
203
 
204
205
 
206
207
208
209
0
@@ -201,9 +201,9 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
0
 
0
   end
0
 
0
-  def test_submit_to_remote
0
+  def test_button_to_remote
0
     assert_dom_equal %(<input name=\"More beer!\" onclick=\"new Ajax.Updater('empty_bottle', 'http://www.example.com/', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)}); return false;\" type=\"button\" value=\"1000000\" />),
0
-      submit_to_remote("More beer!", 1_000_000, :update => "empty_bottle")
0
+      button_to_remote("More beer!", 1_000_000, :update => "empty_bottle")
0
   end
0
 
0
   def test_observe_field

Comments