Forum: Ruby on Rails I'm trying to prepend a parameter to all of my routes

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.
757b8fc749ef56b8f3ba1c9fd89c5aa6?d=identicon&s=25 Jon Hinson (Guest)
on 2008-12-19 16:37
(Received via mailing list)
I'm developing a facebook app and all of my routes go something like
this :org_id/:controller/:action/:id , where all of my urls will be
prepended by this org_id. Is there a way to have all routes recognize
this org_id, even the generated named routes? I have the following in
my routes.rb:

map.connect ':org_id', :controller => 'orgs', :action => 'index'
map.connect ':org_id/:controller/:action/:id'
map.connect ':org_id/:controller/:action:/id.:format'

When I try to go to a route like www.example.com/groups/1, I get this
message:

No action responded to 1

So how do I make all routes recognize the prepended :org_id without
manually making an entry for each one?

Thank you,
Jon
757b8fc749ef56b8f3ba1c9fd89c5aa6?d=identicon&s=25 Jon Hinson (Guest)
on 2008-12-19 18:04
(Received via mailing list)
Never mind, I found the solution- :path_prefix
This topic is locked and can not be replied to.