Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从我的 Ruby on Rails 应用程序中启动几个 CasperJS 脚本。
我想知道两件事:
如果它不是 gem,并且您使用 Rails 3.x 及更高版本,只需将其放入
/app/assets/javascripts
如果
require_tree.
在 application.js 中,它会自动包含上述文件夹中的所有内容。
如果这里有关于包含顺序的问题,请写
//= require xxxxxxx
xxxxxxx 是不带扩展名的 js 文件名
它将按从上到下的顺序包含在内。