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

Pass select list options to Rails form builder #1505

Merged
merged 2 commits into from
Oct 18, 2022
Merged

Conversation

camertron
Copy link
Contributor

Description

Although not intentional, the current implementation of select lists does not allow passing options to the Rails form builder. This came up in #1485 when @raivil tried to add a blank option to the list, which Rails doesn't allow. Instead, you're expected to pass the include_blank argument in the options hash. This PR makes sure arguments like include_blank and its friends are extracted from the hash of input arguments and passed to Rails appropriately.

Closes #1485

Integration

No

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews

@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2022

🦋 Changeset detected

Latest commit: a6f15b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@camertron camertron temporarily deployed to github-pages October 18, 2022 17:57 Inactive
@camertron camertron marked this pull request as ready for review October 18, 2022 17:58
@camertron camertron requested review from a team and BlakeWilliams October 18, 2022 17:58
@camertron camertron merged commit 5d3448b into main Oct 18, 2022
@camertron camertron deleted the allow_select_options branch October 18, 2022 18:22
@primer-css primer-css mentioned this pull request Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to add empty option to select
2 participants