mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Clarify button_to html_options documentation
Further explain how html_options can be used in button_to. Specifically with regard to html_options passed to the button (form submit) element.
This commit is contained in:
parent
912cf2bb66
commit
986cdba7d2
1 changed files with 14 additions and 10 deletions
|
@ -214,20 +214,24 @@ module ActionView
|
||||||
# using the +link_to+ method with the <tt>:method</tt> modifier as described in
|
# using the +link_to+ method with the <tt>:method</tt> modifier as described in
|
||||||
# the +link_to+ documentation.
|
# the +link_to+ documentation.
|
||||||
#
|
#
|
||||||
# By default, the generated form element has a class name of <tt>button_to</tt>
|
# You can control the form and button behavior with +html_options+. Most
|
||||||
# to allow styling of the form itself and its children. This can be changed
|
# values in +html_options+ are passed through to the button element. For
|
||||||
# using the <tt>:form_class</tt> modifier within +html_options+. You can control
|
# example, passing a +:class+ option within +html_options+ will set the
|
||||||
# the form submission and input element behavior using +html_options+.
|
# class attribute of the button element.
|
||||||
# This method accepts the <tt>:method</tt> modifier described in the +link_to+ documentation.
|
#
|
||||||
# If no <tt>:method</tt> modifier is given, it will default to performing a POST operation.
|
# The class attribute of the form element can be set by passing a
|
||||||
# You can also disable the button by passing <tt>disabled: true</tt> in +html_options+.
|
# +:form_class+ option within +html_options+. It defaults to
|
||||||
# If you are using RESTful routes, you can pass the <tt>:method</tt>
|
# <tt>"button_to"</tt> to allow styling of the form and its children.
|
||||||
# to change the HTTP verb used to submit the form.
|
#
|
||||||
|
# The form submits a POST request by default. You can specify a different
|
||||||
|
# HTTP verb via the +:method+ option within +html_options+.
|
||||||
#
|
#
|
||||||
# ==== Options
|
# ==== Options
|
||||||
# The +options+ hash accepts the same options as +url_for+.
|
# The +options+ hash accepts the same options as +url_for+.
|
||||||
#
|
#
|
||||||
# There are a few special +html_options+:
|
# Most values in +html_options+ are passed through to the button element,
|
||||||
|
# but there are a few special options:
|
||||||
|
#
|
||||||
# * <tt>:method</tt> - \Symbol of HTTP verb. Supported verbs are <tt>:post</tt>, <tt>:get</tt>,
|
# * <tt>:method</tt> - \Symbol of HTTP verb. Supported verbs are <tt>:post</tt>, <tt>:get</tt>,
|
||||||
# <tt>:delete</tt>, <tt>:patch</tt>, and <tt>:put</tt>. By default it will be <tt>:post</tt>.
|
# <tt>:delete</tt>, <tt>:patch</tt>, and <tt>:put</tt>. By default it will be <tt>:post</tt>.
|
||||||
# * <tt>:disabled</tt> - If set to true, it will generate a disabled button.
|
# * <tt>:disabled</tt> - If set to true, it will generate a disabled button.
|
||||||
|
|
Loading…
Reference in a new issue