ruby - Rails 'link_to' giving an incorrect path to delete a Nested Resource -
i made simple blog application in rails , when tried giving link delete comment rails gave me incorrect link <a data-method="delete" href="/forums/27/comment.7" rel="nofollow">delete</a> this gave me error no route matches [delete] "/forums/27/comment.7" but when changed <a data-method="delete" href="/forums/27/**comments/7**" rel="nofollow">delete</a> by chrome's inspect deleted comment. how generate correct link ? controller def destroy @comment.destroy redirect_to :back end private def find_forum @forum = forum.find(params[:forum_id]) end def set_comment @comment = comment.find(params[:id]) end show.html.haml - @forum.comments.each |c| = c.user.firstname = c.comment - if user_signed_in? - if c.user == current_user = link_to "delete", [@forum, c], method: :delete routes prefix verb uri patt...