views:

37

answers:

1

How do I determine the link_to arguments for show, edit, and destroy? I know "new" is "new_user_post_path". Nothing else seems to follow this convention though?

My relevant routes.rb snippet:

resources :users do
      resources :posts
end
+2  A: 

Running

rake routes

from your rails root should tell you what you need to know in terms of the name of the routes and the parameters expected.

njorden
So it's just appending "_path" to the route names? I'm still getting routing errors but I suppose at this point it's not actually a routing issue.
chsonnu
That's right, if 'rake routes' gives you a named route of new_post then you can use new_post_path or new_post_url.
njorden