# Problem regarding routes configuration

**URL:** <https://www.ruby-forum.com/t/problem-regarding-routes-configuration/148707>\
**Category:** Rails\
**Created:** [September 16, 2008, 1:25pm UTC](https://www.ruby-forum.com/t/problem-regarding-routes-configuration/148707 "2008-09-16T13:25:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [September 16, 2008, 1:25pm UTC](https://www.ruby-forum.com/t/problem-regarding-routes-configuration/148707/1 "2008-09-16T13:25:05Z")

</div>

Hi,  
Recently, I stepped into a problem while configuring routes to my  
rails app.  
I have a link\_to tag like this:

link\_to ‘healthyliving’, :controller =\> :resources, :action =\>  
:read\_article, :path =\> ‘healthyliving’, :id =\> 1

to achieve a url format  
“localhost:3000/resources/read\_article/healthyliving/1”,  
I have configured a route like this:  
map.connect ‘:controller/:action/:path/:id’, :controller =\> ‘resources’,  
:action =\> ‘read\_article’

This works well when my :path parameter contains only a single phrase  
like ‘healthyliving’ or ‘vitamins’ but fails with the following error:

“no route foound to match  
/resources/read\_article/healthyliving/vitamins/1” when the :path  
contains a combination of phrases like ‘healthyliving/vitamins’ or  
‘healthyliving/vitamins/something’ etc… which is a possible scenario.

I need a url format maintaining the exact :path sent from the link\_to  
tag.  
for ex: when :path =\> ‘healthyliving/vitamins’, I would expect my url to  
be  
localhost:3000/resources/read\_article/healthyliving/vitamins/1

How do I achieve this? Any help appreciated.  
thanks.
