Cool. Thanks for explanation.
Pete
Harold wrote:
> They are both equivalent in terms of functionality.
>
> The first is a common rails idiom:
>
> @some_collection.collect(&:id)
> or
> @some_collection.map(&:id) #I've seen this one used more than
> collect...
>
> The ampersand syntax is simpl
They are both equivalent in terms of functionality.
The first is a common rails idiom:
@some_collection.collect(&:id)
or
@some_collection.map(&:id) #I've seen this one used more than
collect...
The ampersand syntax is simply telling the interpreter that the symbol
is the block parameter to the
2 matches
Mail list logo