Im at the home page and I want to make a link to /card/:id
According to rake routes I have to use cart_path.
The carts route looks like this :
class CartsController < ApplicationController
before_action :set_cart, only: [:show, :edit, :update, :destroy]
def index
@carts = Cart.all
end
def show
end
def new
@cart = Cart.new
end
Which uses this file :
module CurrentCart
extend ActiveSupport::Concern
private
def set_cart
@cart = Cart.find(session[:cart_id])
rescue ActiveRecord::RecordNotFound
@cart = Cart.create
session[:cart_id] = @
cart.id end
end
So I have to figure out how to make the id of the card avaible on the url.
Roelof
Op maandag 8 december 2014 14:38:20 UTC+1 schreef Vivek Sampara: