Rails: Check output of path helper from console

Posted by Thor Thurn on Stack Overflow See other posts from Stack Overflow or by Thor Thurn
Published on 2010-05-17T01:44:59Z Indexed on 2010/05/17 1:50 UTC
Read the original article Hit count: 256

Filed under:

Rails defines a bunch of magic with named routes that make helpers for your routes. Sometimes, especially with nested routes, it can get a little confusing to keep track of what URL you'll get for a given route helper method call. Is it possible to, using the Ruby console, see what link a given helper function will generate? For example, given a named helper like post_path(post) I want to see what URL is generated.

© Stack Overflow or respective owner

Related posts about ruby-on-rails