link_to :confirm displays popup twice

后端 未结 16 1934
感情败类
感情败类 2020-11-30 02:38

This tag with rails 3

<%= link_to \'Destroy\', item, :method => :delete,:confirm=>\'Are you sure?\' %>

produces this html

16条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 03:29

    In my case jQuery was loaded twice because of the line //= require_tree .

    To prevent this error in application.js and application.css I'm used to create a subdirectory app/assets/javascript/autorequire and instead of require_tree . I do require_tree ./autorequire.

    So, files in app/assets/javascript and app/assets/stylesheets are not included automatically/accidentally anymore. I put all my individual .css and .js files into the subdirectory and they are included implicitly. But I can define which files from the top-path are to be included and in which order.

    Since I do so, I never had troubles by assets not loaded as I expect them to be.

提交回复
热议问题