Created
September 9, 2013 17:55
-
-
Save diego-aslz/6499149 to your computer and use it in GitHub Desktop.
How does the `&:name` parameter work?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cities = City.all | |
| cities.map(&:name) # ['City 1', 'City 2'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It uses the
to_procmethod, so it's possible to do this:And this: