Using Rails 3.1, where do you put your “page specific” JavaScript code?

前端 未结 29 2113
一生所求
一生所求 2020-11-22 11:08

To my understanding, all of your JavaScript gets merged into 1 file. Rails does this by default when it adds //= require_tree . to the bottom of your appl

29条回答
  •  一个人的身影
    2020-11-22 11:19

    First: remove \\=require_treefrom application.js Second: all your JS code must be alocated at /app/assets/javascritpt and all your CSS code must be alocated at /app/assets/stylesheets

提交回复
热议问题