Sorry if this has been asked elsewhere, but I can\'t figure this out. I have a forum with sections, topics, and replies. I\'m trying to edit and delete replies from the show
I really dislike this aspect of the link_to
helper. In the interest of making your code more readable and less prone to error, I would suggest that you be explicit about which IDs you are passing in.
<%= link_to 'Edit', edit_section_topic_reply_path(:id => @reply.id,
:topic_id => @topic.id,
:section_id => @section.id) %>
I've run into too many subtle and seemingly insane bugs due to params being out of order in a link_to
.
One more way for edit link
<%= link_to [:edit,@section,@topic,@reply] %>
I think the right order should be:
<%= link_to 'Edit', edit_section_topic_reply_path(@section, @topic, @reply) %>