Skip to content

Instantly share code, notes, and snippets.

@hemalich
Created April 27, 2011 08:22
Show Gist options
  • Save hemalich/943912 to your computer and use it in GitHub Desktop.
Save hemalich/943912 to your computer and use it in GitHub Desktop.
/views/items
collection(@items, :root => "items") do |items|
items.link "self", items_url
# setting :root is unnecessary here but is useful for customizing element names.
items.members(:root => "item") do |m, item|
m.link :self, item_url(item)
m.values { |values|
values.name item.name
values.price item.price }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment