What does map(&:name) mean in Ruby?
I found this code in a RailsCast: def tag_names @tag_names || tags.map(&:name).join(‘ ‘) end What does the (&:name) in map(&:name) mean? 16 s 16 It’s shorthand for tags.map(&:name.to_proc).join(‘ ‘) If foo is an object with a to_proc method, then you can pass it to a method as &foo, which will call foo.to_proc and use that … Read more