mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
b8c9c9d06f
When submitting a `<form>`, browsers will serialize the element that initiated the submission as part of the [FormData][], including its `name` and `value` attributes. Browser support for `<form>` submission HTTP verbs is limited to `GET` and `POST`. Rails currently works around this [limitation by constructing `<input type="hidden" name="_method" value="VERB">` which serializes `_method="VERB"` to the FormData][_method]. To support varied HTTP actions within the same form, this commit intervenes when a `form.button formmethod: "..."` call is made during form construction, and translates any `formmethod:` value to the corresponding work-around version. [FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData [_method]: https://edgeguides.rubyonrails.org/form_helpers.html#how-do-forms-with-patch-put-or-delete-methods-work-questionmark [button-formmethod]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-formmethod |
||
---|---|---|
.. | ||
actionpack | ||
activerecord | ||
fixtures | ||
lib | ||
template | ||
ujs | ||
abstract_unit.rb | ||
active_record_unit.rb |