1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test
Sean Doyle b8c9c9d06f Translate FormBuilder#button calls with formmethod:
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
2021-01-08 18:21:02 -05:00
..
actionpack Remove an unused Action View test fixture 2020-11-01 23:25:29 +00:00
activerecord Revert "Remove redundant @virtual_path variable" 2020-12-30 14:07:09 +01:00
fixtures Failing test for lazy translation in partial with block 2020-12-30 14:07:09 +01:00
lib Include layout when rendering objects from controllers 2020-10-14 11:49:45 -06:00
template Translate FormBuilder#button calls with formmethod: 2021-01-08 18:21:02 -05:00
ujs Merge pull request #40348 from rails/no-erb-in-ujsserver 2020-11-30 01:11:28 -08:00
abstract_unit.rb Revert "Remove redundant @virtual_path variable" 2020-12-30 14:07:09 +01:00
active_record_unit.rb Module#const_set is a public method 2020-09-15 17:19:37 +09:00