ruby on rails link_to delete method not working

后端 未结 7 1516
挽巷
挽巷 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.

    0 讨论(0)
提交回复
热议问题