link_to delete url is not working

前端 未结 7 1457
一个人的身影
一个人的身影 2020-12-06 00:15

I have the following link_to delete url in my app

<%=link_to \"Delete\",blog_path(@blog.id), :method => :delete, :class => \"delete\", :confirm =>         


        
7条回答
  •  南笙
    南笙 (楼主)
    2020-12-06 00:37

    If you're using restful routing for blogs, then the following should work:

    <%= link_to "Delete", @blog, :method => :delete, :confirm => "Are you sure ?"%>
    

提交回复
热议问题