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

Allow for label/value setting in Field::Select collection #1646

Merged
merged 2 commits into from
May 14, 2020
Merged

Allow for label/value setting in Field::Select collection #1646

merged 2 commits into from
May 14, 2020

Conversation

efatsi
Copy link
Contributor

@efatsi efatsi commented May 13, 2020

This mimics the default behavior in Rails select helpers, where you can supply an array of length-2-arrays, and each collection item is understood as [label, value].

["Last Year", 2019],
["This Year", 2020]
],
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit of a hacky way to test out the new functionality. Let me know if you'd prefer I add some arbitrary functionality to the example app to avoid the use of temporarily resetting this attribute type.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

["Last Year", 2019],

Copy link
Member

@nickcharlton nickcharlton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for contributing.

@nickcharlton nickcharlton merged commit e820e3b into thoughtbot:master May 14, 2020
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.

3 participants