Restful routes and Rails Console




I am trying to see what comments_url resolves to in the Rails Console,
but do not know how.

There’s a good reason for this: You don’t use/need urls in your
The best way is to write tests for your routes, this will also give
you the
most confidence in your own code.

If you want to test routes, shoulda[1] has macros for that. For rspec users, that would be carlosbrando-remarkable[2].

If you still want to puch this stuff into console,

include ActionController::UrlWriter


=> “/session/new”

See if this helps.

[1] Projects - Shoulda

[2] carlosbrando’s remarkable at master - GitHub