Why doesn't the new Rails 3.2.2 application include lib / assets in the resource path?

I recently wrote a blog post and found out that the lib/assets folder should be included in the list of resource paths. If I create a new Rails application using 3.2.2, start the console and run the y Rails.application.config.assets.paths command y Rails.application.config.assets.paths I do not see lib / assets. Should this not be enabled by default?

Here's how I got there:

 $ rails new example $ cd example $ rails c >> y Rails.application.config.assets.paths --- - /Users/eberry/Playground/example/app/assets/images - /Users/eberry/Playground/example/app/assets/javascripts - /Users/eberry/Playground/example/app/assets/stylesheets - /Users/eberry/Playground/example/vendor/assets/javascripts - /Users/eberry/Playground/example/vendor/assets/stylesheets - /Users/eberry/.rvm/gems/ruby-1.9.2-p290/gems/jquery-rails-2.0.2/vendor/assets/javascripts - /Users/eberry/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.2.2/lib/assets/javascripts => nil >> 

Any help would be greatly appreciated.

+7
source share
5 answers

I do not have Rails installed on this computer, but from the original link it looks like lib/assets will never be included, but any subfolders will be.

Try creating lib/assets/javascripts and see if it is turned on automatically.

+3
source

Do you have anything in any lib folder? I have one js file in the lib / assets / javascripts folder, and when I check the resource paths, only one path is displayed, i.e. lib / assets / javascripts /, but not lib / assets / images or lib / assets / stylesheets, since I did not create these folders.

I'm on Rails 3.2.3.

+1
source

I had the same problem.

Put at least one file, for example, in lib/assets/javascripts , and then restart the application.

Now rails c and Rails.application.config.assets.paths should contain lib/assets/javascripts .

+1
source

I encountered the same problem on rails 3.2 you have to put your scripts in the "assets / javascripts" folder and they will be included, otherwise not.

0
source

Any subfolder (and not just stylesheets / images / javascripts) that you created under lib / assets will be added to the download path.

Tested with rails 3.2.11.

Use "rails c" and type "y Rails.application.config.assets.paths" to check the path to the resource.

I believe this is the same with providers / assets and applications / assets, but I'm not sure what it is.

0
source

All Articles