Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Rails 3.1 concatenate assets in development mode?

I am having trouble getting the asset pipeline to concatenate (but not compress!) assets in development. The idea is that I can stop making 70+ requests for tiny css/js files for every development page load, but still get to view a line number so I can figure out where problems are.

My config/environments/development.rb has this, which I interpret the rails guide to mean that assets should be compiled into one file, but not compressed:

config.assets.compress = false
config.assets.compile = true
config.assets.digest = false
config.assets.debug = false

But no dice: assets are still served individually instead of concatenated within application.js.

Any help would be appreciated!

like image 872
bhuga Avatar asked Apr 18 '12 18:04

bhuga


1 Answers

Try to add debug: false to your include/link-tags

# in views/layouts/application.html.haml (or .erb, then use <%= %>)
= stylesheet_link_tag    "application", debug: false
= javascript_include_tag "application", debug: false

No need to restart app! I hope you didn't forget to do it after you had changed your development.rb ;-).

Tell if it works for you (because your settings made my development mode to concatenate js/css-files easy).

Only as temporary solution, of course.

like image 93
jdoe Avatar answered Jan 05 '23 03:01

jdoe