Hi,
I am having some issue with the path while running the stories. Below is
my controller code.
class ShopController < ApplicationController
def add_to_cart
# My code here…
end
end
in routes i have the following,
with_options :controller => “shop”, :action => “index”, :requirements =>
{ :method => :get } do |shop|
shop.add_to_cart “shops/:shop_id/add_to_cart/:product_id”,
:action => ‘add_to_cart’
end
When I run my application I get everything working correctly.
“add_to_cart_path(@shop, @product)” returns “/shop/add_to_cart/1”
while running the application.
But when I run the same in my stories, I am getting an error with the
path. The path just returns “/add_to_cart/1”. I don’t know why it is not
running correctly in the stories.
Any suggestions are appreciated.
Thanks in advance…