Recently, I stepped into a problem while configuring routes to my
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
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
for ex: when :path => 'healthyliving/vitamins', I would expect my url to
How do I achieve this? Any help appreciated.