simontol
simontol

Reputation: 85

rails assets stylesheets config.rb

I have this file app/assets/stylesheets/config.rb with the following content:

http_path = "/"
css_dir = "."
sass_dir = "."
images_dir = "img"
javascripts_dir = "js"
output_style = :compressed
relative_assets=true
line_comments = false

what is it for?

Upvotes: 3

Views: 1371

Answers (3)

Viktor Oleksyn
Viktor Oleksyn

Reputation: 624

You can fix it by removing Live Reload plugin from Sublime Text.

Sublime Text > Preferences > Package Control > Remove Package > Live Reload

For me it's good solution because I didn't using Live Reload. Who using live reload please follow issue: github.

Upvotes: 0

tehfoo
tehfoo

Reputation: 328

To answer your question "what is it for", it's configuration for the Compass scss compiler. The reference in the other answer is handy, but for up to date details without speculation check out the details of the Compass configuration file here:

http://compass-style.org/help/tutorials/configuration-reference/

I had originally posted to also provide an answer for where the file came from (if you didn't create it yourself. I answer this because it was 'magially' appearing in my Rails project, and a Google search for generation of config.rb in Rails ends up here. I first supsected sass-rails, but someone from that project confirmed they don't generate that file. Then I figured out that auto-generation of this file was being caused by Sublime Text with the LiveReload package. See the related github issue.

Upvotes: 5

jefflunt
jefflunt

Reputation: 33954

I'm guessing that it defines how to find assets from the stylesheets folder, and some output options on what happens to the assets before being sent to the client browser.

http_path = "/"              <= probably the root path to assets, so if you had
                                application.css, the URL path to it would be
                                http://example.com/application.css
css_dir = "."                <= the directory to look for css files. "." in linux
                                means "the current directory", so this would set you
                                CSS path to app/assets/stylesheets
sass_dir = "."               <= same as above, except for .sass/.scss files
images_dir = "img"           <= images go in app/assets/stylesheets/img
javascripts_dir = "js"       <= javascript go in app/assets/stylesheets/js
                                (seems like a strange place to put them)
output_style = :compressed   <= either to produce .gzip'ed versions of files
                                or to minify them, maybe both - consult docs on this
relative_assets=true         <= relative, as opposed to absolute paths to assets, I think
line_comments = false        <= I think this turns on/off the ability to include comments,
                                or maybe whether the comments are included in the
                                compressed versions of the file. turn it to "true" and
                                compare the assets, as served to the browser, and see
                                what the difference is

Upvotes: 0

Related Questions