Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% @products.each do |product| %>
- <div class="entry">
- <%= image_tag(product.image_url) %>
- <h3><%= product.title %></h3>
- <%= sanitize(product.description) %>
- <div class="price_line">
- <span class="price"><%= number_to_currency(product.price, unit: '$') %></span>
- <%= button_to 'Add to Cart', line_items_path(product_id: product) %>
- </div>
- </div>
- <% end %>
- class LineItem < ActiveRecord::Base
- attr_accessible :cart_id, :product_id
- belongs_to :product
- belongs_to :cart
- end
- line_items_path(product)
- line_items_path(product_id: product)
- line_items_path(:product_id => product)
- line_items_path({:product_id => product})
Add Comment
Please, Sign In to add comment