Fernando Perez wrote:
> You almost have it all correct, just in your view:
>
> <%= form_for([@article, @comment]) do |f| %>
>
>
> --
>
> http://digiprof.tv
That worked excellently.
I have one more question about the same set of files. I want to add a
link for editing the comments on the article show page, but I am getting
an error.
This is the code I am using to display the edit comment link:
<%= link_to "Edit Comment", edit_comment_path(comment) %>
Here is the error I get:
undefined method `edit_comment_path' for #<#<Class:0xa2f2c90>:0xa2f04f4>
I think the reason I get the error is that I am using the code in the
article show page, which is in the article controller, and so there is
no predefined path to 'edit_comment_path'. Is there a way to access the
path inside of article and send the object 'comment' to it?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment