I found that I can just call require 'config/routes' at the right time in my action to rebuild the entire routing table. That's good enough for me.
Thanks. Michael On Sep 19, 9:57 pm, Phlip <[EMAIL PROTECTED]> wrote: > Michael Allman wrote: > > Is it possible to alter a Rails app's routing table at runtime? I > > want to be able to add and remove routes from an admin application. > > I would put p 'yo' inside the route map, run the app, and see how often it > prints. I don't know if it's once per route, once per action, or only at > startup > time. > > However, if you need to think outside the route box entirely, I suspect you > can > use this: > > map.any_route '/*paths', :controller => 'foo', :action => 'any_action' > > Now the system will call any_action with a params[:paths] set to an array of > each /path/element/ in an URI. Then you parse and dispatch them yourself. > > But I can't think of any reason to add or remove routes in a way that solves > an > actual web problem... > > -- > Phlip --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

