Dirk Bergmann

Developer, panographer. Does consultancy work from own company. Lives in Chiang Mai, Thailand.


Chiang Mai

Hua Hin

Thailand Hotels

ListVote - List. Vote. Learn.

Partnerseek - Find Partners

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…