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

Country#all accepts a block to customize the output #34

Merged
merged 1 commit into from
Dec 13, 2012

Conversation

cibernox
Copy link
Contributor

Very simple and useful.

@cibernox
Copy link
Contributor Author

A simple use case for this feature: Build a custom country select with extra information:

ops = options_for_select Country.all { |country, data| [data['name'], country, {'data-code' => data['country_code']}] }
f.select :phone_country, opts

hexorx added a commit that referenced this pull request Dec 13, 2012
Country#all accepts a block to customize the output
@hexorx hexorx merged commit 0355ecf into countries:master Dec 13, 2012
@hexorx
Copy link
Collaborator

hexorx commented Dec 13, 2012

I Love it. Thank you.

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.

2 participants