Module | Pickle::Path |
In: |
lib/pickle/path.rb
|
given args of pickle model name, and an optional extra action, or segment, will attempt to find a matching named route
path_to_pickle 'the user', :action => 'edit' # => /users/3/edit path_to_pickle 'the user', 'the comment' # => /users/3/comments/1 path_to_pickle 'the user', :segment => 'comments' # => /users/3/comments
If you don;t know if the ‘extra’ part of the path is an action or a segment, then just pass it as ‘extra’ and this method will run through the possibilities
path_to_pickle 'the user', :extra => 'new comment' # => /users/3/comments/new