简体   繁体   中英

Ruby on Rails - jQuery javascripts as default

I have added this to my config/application.rb file:

config.action_view.javascript_expansions[:defaults] = %w(jquery rails application)

and I have added this to my views/layouts/application.html.erb file:

<%= javascript_include_tag :defaults %>

But the prototype javascript files are being included and not the jQuery files when the pages are rendered. Any ideas why this is happening?

I usually just add https://github.com/indirect/jquery-rails as a development gem, and then run the generators. Haven't run into an issue yet.

重新启动服务器,从而解决了该问题。

现在它默认支持

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM