Forum: Ruby on Rails Noobish URI Question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
The B. (Guest)
on 2006-04-11 17:45
Sorry if the answer has been posted but the search terms (like URI) are
so generic I get tons of useless results.

I have a controller (in this case "forum_controller") so if I want to
read a forum topic the URI is "/forum/topic/1".  As of right now for
adding a new topic my URI is setup as "/forum/new_topic".

I'd really like it to be something like "/forum/topic/new".  Is there
some method naming convention in the controller to allow for this?
Jeroen van Doorn (Guest)
on 2006-04-11 18:00
(Received via mailing list)
you could do this with routing I presume ...

you'll get something like

  map.connect  "forum/topic/new",
                         :controller => "forum",
                         :action =>     "new_topic"

Kind regards,
Jeroen
The B. (Guest)
on 2006-04-11 18:07
Jeroen van Doorn wrote:
> you could do this with routing I presume ...
>
> you'll get something like
>
>   map.connect  "forum/topic/new",
>                          :controller => "forum",
>                          :action =>     "new_topic"
>
> Kind regards,
> Jeroen

Yeah, I was hoping I could do something like name the method topic::new
or something similar but that didn't work.  I'll just leave it as
new_topic for now instead of creating custom routes for each instance.
This topic is locked and can not be replied to.