Rails 4 link_to Destroy not working in Getting Started tutorial

前端 未结 13 1132
野性不改
野性不改 2020-11-27 04:48

I am working through the Getting Started tutorial (creating a Blog) and the link_to Destroy is not functioning properly. In the terminal it always interprets it as #SHOW. <

13条回答
  •  生来不讨喜
    2020-11-27 05:38

    I had same problem. In my case, a i had change \app\views\layouts\application.html.erb file from

    <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
    

    to

    <%= stylesheet_link_tag    'default', media: 'all', 'data-turbolinks-track' => true %>
    <%= javascript_include_tag 'default', 'data-turbolinks-track' => true %>
    

    to avoid my very first Rails problem. But it apparently mangled JavaScript execution and caused Destroy issue. Therefore rollback your \app\views\layouts\application.html.erb file to its original state, and treat this problem as here

    Rails ExecJS::ProgramError in Pages#home?

    in evedovelli answer (about coffeescript gem in windows).

提交回复
热议问题