# Issue with routes while running the STORIES

**URL:** <https://www.ruby-forum.com/t/issue-with-routes-while-running-the-stories/148574>\
**Category:** Rails\
**Created:** [September 15, 2008, 8:45am UTC](https://www.ruby-forum.com/t/issue-with-routes-while-running-the-stories/148574 "2008-09-15T08:45:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikeyan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/898d66/32.png) [@karthikeyan](https://www.ruby-forum.com/u/karthikeyan)\
**Post date:** [September 15, 2008, 8:45am UTC](https://www.ruby-forum.com/t/issue-with-routes-while-running-the-stories/148574/1 "2008-09-15T08:45:57Z")

</div>

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…
