Interactive Routes via Rails Console
It's helpful at times to drop into the rails console to see how your routes are generating. Rails 3 makes this really easy by exposing the app object in console. From there you can simply start calling named routes off of the app object...
app.root_url
=> "http://www.example.com/"app.posts_url
=> "http://www.example.com/posts"app.post_url(1)
=> "http://www.example.com/posts/1"
Written by Kyle Bolton
Related protips
1 Response
That's cool! For me, I've been using sextant to access rake routes from the browser instantly. https://github.com/schneems/sextant
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#