Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias field_set_tag helper to fieldset_tag #50241

Merged
merged 1 commit into from Dec 2, 2023

Conversation

seanpdoyle
Copy link
Contributor

Motivation / Background

The field_set_tag renders a <fieldset> element. At times, the desire to render a fieldset results in calling fieldset_tag, only to be surprised by a NoMethodError.

Originally, the method's name was fieldset_tag helper (defined in 0e6c8e5 in 2007), but was renamed in 73c7083 (3 days later).

Detail

This commit aliases field_set_tag to fieldset_tag so that both are available.

Additional information

Additionally, defines the method so that it utilizes the content_tag so that it isn't responsible for manually managing the closing (</fieldset>) of the opening <fieldset> tag.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

The [field_set_tag][] renders a `<fieldset>` element. At times, the
desire to render a `fieldset` results in calling `fieldset_tag`, only to
be surprised by a `NoMethodError`.

Originally, the method's name was `fieldset_tag` helper (defined in
[0e6c8e5][] in 2007), but was renamed in [73c7083][] (3 days later).

This commit aliases `field_set_tag` to `fieldset_tag` so that both are
available.

Additionally, defines the method so that it utilizes the [content_tag][]
so that it isn't responsible for manually managing the closing
(`</fieldset>`) of the opening `<fieldset>` tag.

[field_set_tag]: https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-field_set_tag
[0e6c8e5]: rails@0e6c8e5
[73c7083]: rails@73c7083
[content_tag]: https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag
@rails-bot rails-bot bot added the actionview label Dec 2, 2023
@byroot byroot merged commit 90daef6 into rails:main Dec 2, 2023
3 of 4 checks passed
@seanpdoyle seanpdoyle deleted the fieldset-tag-alias branch December 2, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants