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 c6c138ef86 Generate [id] for FormBuilder#button called with method name
Follow-up to [rails/rails#43411][] (merged in [15f6113][])

By default, when generating a `<button>` element through a Form Builder
instance, the element's `[name]` attribute is populated by calling the
`FormBuilder#field_name` method. This commit assigns a matching default
`[id]` attribute generated by `FormBuilder#field_id`.

Additionally, it adds test coverage to ensure that calls that provide
their own `name:` and `id:` options are not overridden by the default
values.

[rails/rails#43411]: https://github.com/rails/rails/pull/43411
[15f6113]: 15f6113622
2021-12-15 17:49:28 -05:00
..
actionpack Execute field_error_proc within view 2021-10-29 10:07:04 -04:00
activerecord Add autocomplete="off" to all generated hidden fields (fixes #42610) 2021-09-21 15:57:56 -04:00
fixtures Merge pull request #43368 from FestaLab/render-hash-syntax 2021-12-08 18:13:44 -05:00
lib Enable Style/ExplicitBlockArgument cop 2021-09-05 17:06:19 +02:00
template Generate [id] for FormBuilder#button called with method name 2021-12-15 17:49:28 -05:00
ujs Fix spelling in CoffeeScript and JavaScript files [ci skip] 2021-05-05 11:08:33 +10:00
abstract_unit.rb Delete AS::Dependencies.unhook! 2021-08-17 05:18:22 +02:00
active_record_unit.rb Module#const_set is a public method 2020-09-15 17:19:37 +09:00