Accessing Routes in script/console

In script console the app object exposes ActionController::Integration::Session which contains all your routes, so you can go:


etc. No need (comment) to include ActionController::UrlWriter

But to use your routes in the model, you wouldn’t use an instance of ActionController::Integration::Session, no, don’t, it’s a terrible hack, dirty and immoral, bordering on evil, MVC abused and perverted. Then again, you never know…

Posted: 11 February 2009

comments powered by Disqus