--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Returns a button with the given <tt>name</tt> text that'll trigger a JavaScript <tt>function</tt> using the onclick handler.
- !ruby/struct:SM::Flow::P 
  body: The first argument <tt>name</tt> is used as the button's value or display text.
- !ruby/struct:SM::Flow::P 
  body: The next arguments are optional and may include the javascript function definition and a hash of html_options.
- !ruby/struct:SM::Flow::P 
  body: The <tt>function</tt> argument can be omitted in favor of an <tt>update_page</tt> block, which evaluates to a string when the template is rendered (instead of making an Ajax request first).
- !ruby/struct:SM::Flow::P 
  body: The <tt>html_options</tt> will accept a hash of html attributes for the link tag. Some examples are :class =&gt; &quot;nav_button&quot;, :id =&gt; &quot;articles_nav_button&quot;
- !ruby/struct:SM::Flow::P 
  body: "Note: if you choose to specify the javascript function in a block, but would like to pass html_options, set the <tt>function</tt> parameter to nil"
- !ruby/struct:SM::Flow::P 
  body: "Examples:"
- !ruby/struct:SM::Flow::VERB 
  body: "  button_to_function &quot;Greeting&quot;, &quot;alert('Hello world!')&quot;\n  button_to_function &quot;Delete&quot;, &quot;if (confirm('Really?')) do_delete()&quot;\n  button_to_function &quot;Details&quot; do |page|\n    page[:details].visual_effect :toggle_slide\n  end\n  button_to_function &quot;Details&quot;, :class =&gt; &quot;details_button&quot; do |page|\n    page[:details].visual_effect :toggle_slide\n  end\n"
full_name: ActionView::Helpers::JavaScriptHelper#button_to_function
is_singleton: false
name: button_to_function
params: (name, *args, &block)
visibility: public
