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

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Generates a form containing a single button that submits to the URL created by the set of <tt>options</tt>. This is the safest method to ensure links that cause changes to your data are not triggered by search bots or accelerators. If the HTML button does not work with your layout, you can also consider using the link_to method with the <tt>:method</tt> modifier as described in the link_to documentation.
- !ruby/struct:SM::Flow::P 
  body: The generated FORM element has a class name of <tt>button-to</tt> to allow styling of the form itself and its children. You can control the form submission and input element behavior using <tt>html_options</tt>. This method accepts the <tt>:method</tt> and <tt>:confirm</tt> modifiers described in the link_to documentation. If no <tt>:method</tt> modifier is given, it will default to performing a POST operation. You can also disable the button by passing <tt>:disabled =&gt; true</tt> in <tt>html_options</tt>. If you are using RESTful routes, you can pass the <tt>:method</tt> to change the HTTP verb used to submit the form.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Options
- !ruby/struct:SM::Flow::P 
  body: The <tt>options</tt> hash accepts the same options at url_for.
- !ruby/struct:SM::Flow::P 
  body: "There are a few special <tt>html_options</tt>:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:method</tt> - Specifies the anchor name to be appended to the path.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:disabled</tt> - Specifies the anchor name to be appended to the path.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:confirm</tt> - This will add a JavaScript confirm prompt with the question specified. If the user accepts, the link is processed normally, otherwise no action is taken.
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;%= button_to &quot;New&quot;, :action =&gt; &quot;new&quot; %&gt;\n  # =&gt; &quot;&lt;form method=&quot;post&quot; action=&quot;/controller/new&quot; class=&quot;button-to&quot;&gt;\n  #      &lt;div&gt;&lt;input value=&quot;New&quot; type=&quot;submit&quot; /&gt;&lt;/div&gt;\n  #    &lt;/form&gt;&quot;\n\n  button_to &quot;Delete Image&quot;, { :action =&gt; &quot;delete&quot;, :id =&gt; @image.id },\n            :confirm =&gt; &quot;Are you sure?&quot;, :method =&gt; :delete\n  # =&gt; &quot;&lt;form method=&quot;post&quot; action=&quot;/images/delete/1&quot; class=&quot;button-to&quot;&gt;\n  #      &lt;div&gt;\n  #        &lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;delete&quot; /&gt;\n  #        &lt;input onclick=&quot;return confirm('Are you sure?');&quot;\n  #              value=&quot;Delete&quot; type=&quot;submit&quot; /&gt;\n  #      &lt;/div&gt;\n  #    &lt;/form&gt;&quot;\n"
full_name: ActionView::Helpers::UrlHelper#button_to
is_singleton: false
name: button_to
params: (name, options = {}, html_options = {})
visibility: public
