Forum: Rails deployment Is "ampersand-colon" a preferable way to pass a proc to a method in Rails source?

63c72161fba6e27cb05c078651c5e969?d=identicon&s=25 Alexey Muranov (alexey_m)
on 2011-12-11 15:29
Hello, i am trying to fix a bug in Rails, and also improve readability
of the code i am coming across in this process.  I have a question: is

  map(&:to_s)

preferred over

  map { |n| n.to_s }

?

I was going to use the first form, but decided to ask first.

Alexey.
63c72161fba6e27cb05c078651c5e969?d=identicon&s=25 Alexey Muranov (alexey_m)
on 2011-12-11 15:39
Sorry, this was probably a wrong forum to post this.
This topic is locked and can not be replied to.