提交 25181caf 编写于 作者: X Xavier Noria

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.
上级 f9472f06
......@@ -105,7 +105,7 @@ def javascript_cdata_section(content) #:nodoc:
# button_to_function "Greeting", "alert('Hello world!')", :class => "ok"
# # => <input class="ok" onclick="alert('Hello world!');" type="button" value="Greeting" />
#
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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册