ruby on rails link_to delete method not working

后端 未结 7 1496
挽巷
挽巷 2021-02-14 06:04

I am trying to delete a post using the code below:

<%= link_to \'Destroy\', post, :method => :delete, :onclick => \"return confirm(\'Are you sure you wa         


        
7条回答
  •  感动是毒
    2021-02-14 06:51

    You must be add

    //= require jquery
    //= require jquery_ujs
    

    in javascripts/application.js file

    second, check in layout file,

    javascript_include_tag "application"
    

    is include or not?

    Hope this help.

提交回复
热议问题