nesquena/rabl — pull request #127 by brentmurphy (2011-10-19 08:34:25+00:00)
Title: Use code block with collections (relating to issue #120)

This patch makes the name supplied to the code method optional, allowing it to be used with collections. For example:

collection @users
code do |user|
{:name => "user - #{user.name}"}
end

Each element in the collection has a name attribute with the calculated value. Or:

collection @users
code do |user|
partial("users/#{user.sti_type}", :object => user)
end

Code without a name argument expects the associated block to return a hash.