SHARE
TWEET

Untitled

a guest Feb 25th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ShopController < ApplicationController
  2.  
  3.     def index
  4.         #render :text => "Hello in my shop"
  5.         @categories = Category.all
  6.         @products = Product.all
  7.     end
  8.  
  9.     def product
  10.         @product = Product.find(params[:id])
  11.     end
  12.  
  13.     def category
  14.         @category = Category.find(params[:id])
  15.     end
  16.  
  17.     def to_cart
  18.         @product = Product.find(params[:id])
  19.         current_order.add_product product
  20.         redirect_to root_path
  21.     end
  22. end
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