daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Jan 15th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <% @products.each do |product| %>
  2. <div class="entry">
  3. <%= image_tag(product.image_url) %>
  4. <h3><%= product.title %></h3>
  5. <%= sanitize(product.description) %>
  6. <div class="price_line">
  7.   <span class="price"><%= number_to_currency(product.price, unit: '$') %></span>
  8.   <%= button_to 'Add to Cart', line_items_path(product_id: product) %>
  9. </div>
  10. </div>
  11. <% end %>
  12.    
  13. class LineItem < ActiveRecord::Base
  14.   attr_accessible :cart_id, :product_id
  15.   belongs_to :product
  16.   belongs_to :cart
  17. end
  18.    
  19. line_items_path(product)
  20.    
  21. line_items_path(product_id: product)
  22.    
  23. line_items_path(:product_id => product)
  24.    
  25. line_items_path({:product_id => product})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top