Skip to content

Commit c15658c

Browse files
authored
Merge pull request rails#50896 from yin0110/fix/button_to_explanation_improve
Improve ActionView::Helpers::UrlHelper button_to explanation [ci-skip]
2 parents 351a8d9 + fd64d16 commit c15658c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

actionview/lib/action_view/helpers/url_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
220220
# +:form_class+ option within +html_options+. It defaults to
221221
# <tt>"button_to"</tt> to allow styling of the form and its children.
222222
#
223-
# The form submits a POST request by default. You can specify a different
224-
# HTTP verb via the +:method+ option within +html_options+.
223+
# The form submits a POST request by default if the object is not persisted;
224+
# conversely, if the object is persisted, it will submit a PATCH request.
225+
# To specify a different HTTP verb use the +:method+ option within +html_options+.
225226
#
226227
# If the HTML button generated from +button_to+ does not work with your layout, you can
227228
# consider using the +link_to+ method with the +data-turbo-method+

0 commit comments

Comments
 (0)