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 jquery 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
:defaultwhen it should be:defaults. The code in yourconfig/environment.rbandconfig/environments/*files will be overriding whatever it is that is inapplication.rb.