Short-syntax for Array#map
Instead of doing
@emails = @users.map { |i| i.email }
You can do
@emails = @users.map(&:email)
Written by Ariejan de Vroom
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#