public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Allow prototype functions to receive position parameter as a symbol.

[#887 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
miloops (author)
Sat Aug 30 15:49:32 -0700 2008
jeremy (committer)
Sat Aug 30 16:35:25 -0700 2008
commit  367a55e1b8deb87e7388cb97b2ac8c28a0796c89
tree    22f27274a97f77185f85187f8593727191a324be
parent  cb25c4e5849dc3b803784ad985ea1cb4e43b0c74
...
1060
1061
1062
1063
 
1064
1065
1066
...
1060
1061
1062
 
1063
1064
1065
1066
0
@@ -1060,7 +1060,7 @@ module ActionView
0
 
0
         js_options['asynchronous'] = options[:type] != :synchronous
0
         js_options['method']       = method_option_to_s(options[:method]) if options[:method]
0
-        js_options['insertion']    = options[:position].to_s.downcase if options[:position]
0
+        js_options['insertion']    = "'#{options[:position].to_s.downcase}'" if options[:position]
0
         js_options['evalScripts']  = options[:script].nil? || options[:script]
0
 
0
         if options[:form]
...
79
80
81
 
 
82
83
84
...
79
80
81
82
83
84
85
86
0
@@ -79,6 +79,8 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
0
       link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot", :a => '10', :b => '20' })
0
     assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:false, evalScripts:true}); return false;\">Remote outauthor</a>),
0
       link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :type => :synchronous)
0
+    assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, insertion:'bottom'}); return false;\">Remote outauthor</a>),
0
+      link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :position => :bottom)
0
   end
0
 
0
   def test_link_to_remote_html_options

Comments