Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Created February 27, 2014 16:54
Show Gist options
  • Save mikecmpbll/9254169 to your computer and use it in GitHub Desktop.
Save mikecmpbll/9254169 to your computer and use it in GitHub Desktop.
def show
@purchase = Purchase.find(params[:id])
end
<ul>
<% @purchase.purchase_items.includes(:item).each do |pi| %>
<li>Item name: <%= pi.item.name %></li>
<li>Quantity purchased: <%= pi.quantity %></li>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment