On Tue, May 18, 2010 at 1:16 AM, sso <strongsilent...@gmail.com> wrote:
> These are the routes I would like:
>  map.forums_new_topic 'forums/:forum_id/:subsection_id/topics/
> new', :controller => "topics", :action => "new"
>  map.forums_show_topic
> 'forums/:forum_id/:subsection_id/:topic_id', :controller =>
> "topics", :action => "show"
>
> however no matter which order they're in it seems like it always tries
> to use the "show" route and it crashes because "topics" isn't a id.
>
> Suggestions?  Am I doing this the right way?

Maybe if you restricted the format of the topic_id

map.forums_show_topic 'forums/:forum_id/:subsection_id/:topic_id',
:topic_id => /\d+/, :controller => 'topics', :action => 'show'


-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to