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

Posted by 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.
Posted by Alexey Muranov (alexey_m)
on 2011-12-11 15:39
Sorry, this was probably a wrong forum to post this.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.