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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jon Hinson (Guest)
on 2008-12-19 17: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, I get this

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 Hinson (Guest)
on 2008-12-19 19:04
(Received via mailing list)
Never mind, I found the solution- :path_prefix
This topic is locked and can not be replied to.