What exactly "config.assets.debug" setting does?

asset-pipeline, ruby, ruby-on-rails

Solution

This option's effect is well described in this post, but I'll summarize it here as well. The value of changing `config.assets.debug` lies in a compromise between page load time in development and ease of debugging.

Basically:

`config.assets.debug = true`: assets are served individually, organized just as you see them in development. Preprocessed languages like SASS or CoffeeScript will still show up as their target languages (i.e., CSS and JS, respectively).

`config.assets.debug = false`: assets are bundled into files like `application.css` and `application.js`. Error stack traces will likely not have the correct line number any more and it is harder to map those back to your original code.

Problem

I have started development of simple rails application. After several hours work I have notices that somehow the deleted css is still applied to the web pages. In order to fix the issue I executed the following actions several times: - stop/start server - use rails server - use torquebox server - delete browser cache but nothing changes. It was very strange - the new css definitions were applied, but those that I have deleted were still there. So, I gave up and decided to create new project. I have setup the new project (its scaffold is the same as the first one) and when I open one of the views, the styles from the old project were applied too. I have decided to look again into http://guides.rubyonrails.org/asset_pipeline.html and find out that setting ``` #Expands the lines which load the assets config.assets.debug = false ``` solves the issue. But what is this option doing exactly? Why the old projects css were applied when this was true?

Original source