indirect / jquery-rails

A gem to automate using jQuery with Rails 3
MIT License
465 stars 36 forks source link

Error when an app is created with the -J flag #54

Closed fortuity closed 13 years ago

fortuity commented 13 years ago

If an app is created with rails new testapp -J

(using the "-J" flag to eliminate the Prototype files)

then in the config/application.rb file

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

is not commented out and lib/jquery-rails.rb cannot override config.action_view.javascript_expansions[:defaults]

to include the jquery files and you'll get an error "No expansion found for :defaults" when you run your app.

The README should say not to use the -J flag (since some people assume it is necessary when switching from Prototype to jQuery). Or the jquery-rails generator should modify the config/application.rb file to make sure the config.action_view.javascript_expansions[:defaults] setting is commented out.

mdesantis commented 13 years ago

+1 for this; I add the same identical problem

indirect commented 13 years ago

Rails 3.1 now defaults to using -j jquery, and the 1.0.1 release works fine with that. Thanks for the reports!