开发者

No expansion error found for :default in rails using jquery development jquery.min production

开发者 https://www.devze.com 2023-03-15 00:03 出处:网络
I have the following line in my development.rb file: config.action_view.javascript_expansions = { :default => [:jquery] }

I have the following line in my development.rb file:

config.action_view.javascript_expansions = { :default => [:jquery] }

and the following in my production.rb file:

config.action_view.javascript_expansions = { :default => ["jquery.min"] }

I have installed a jquery to be used in my rails app with the jquery gem. No prototype installed.

I have uncommented the following line in my application.rb file:

  # JavaScript files you want as :defaults (application.js is always included).
     config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

I want to user regular jquery for development and then jq开发者_开发问答uery mini for production. This configuration causes the following error:

No expansion found for :defaults

How can I fix this error while still having different jquery environments for production and development?

Thank you in advance.


You're calling it the wrong name. You're saying it's :default when it should be :defaults. The code in your config/environment.rb and config/environments/* files will be overriding whatever it is that is in application.rb.

0

精彩评论

暂无评论...
验证码 换一张
取 消