From 25181cafee9ef087a14b5134b9fa1f85f758705a Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 25 Mar 2011 09:44:43 +0100 Subject: let the default function in button_to_function be nil I don't know which is the use case for button_to_function(name) but there's a test for it. I am focused now on RJS extraction and do not want to introduce a backwards incompatible change at this moment. Perhaps worth revisiting when the whole thing is done. --- actionpack/lib/action_view/helpers/javascript_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 5a1d07fd24..066f0ab409 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -105,7 +105,7 @@ module ActionView # button_to_function "Greeting", "alert('Hello world!')", :class => "ok" # # => # - def button_to_function(name, function='', html_options={}) + def button_to_function(name, function=nil, html_options={}) onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function};" tag(:input, html_options.merge(:type => 'button', :value => name, :onclick => onclick)) -- cgit v1.2.3