Created
April 27, 2011 08:22
-
-
Save hemalich/943912 to your computer and use it in GitHub Desktop.
/views/items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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