I have a Post model and a Comment model (which is a nested resource of the first model):
resources :posts do
resources :comments
end
posts/show.html.erb:
<%= render @comments %>
I think I have some error in here:
comments/_comment.erb
<%= link_to "Edit Post Comment", [@post, edit_comment_path(comment)] %>
because I get this error:
undefined method `edit_comment_path' for #<#<Class:0xb439d8c>:0xaeaf4c0>
Any suggestions to fix this?
If you run
rake routesyou can see the route names, in your case the route name should beedit_post_comment_pathrather than justedit_comment_path.