0

To precompile all css files in a project I could add this to production.rb:

config.assets.precompile << '*.css'

But how can I add only css files in a particular folder?

Undistraction
  • 42,754
  • 56
  • 195
  • 331

1 Answers1

1

Add all stylesheets into your app/assets/stylesheets/application.css:

/*
 *= require_self
 *= require_tree dir_one
 *= require_tree dir_two
 */ 

Then they will be precompiled. I think this is the preferred way over using config.assets.precompile.

If you really want to use it, this SO question should help: How do I use config.assets.precompile for directories rather than single files?

Community
  • 1
  • 1
Sven Koschnicke
  • 6,523
  • 2
  • 34
  • 49
  • Thanks. This is the default, but it's no good if you want page-specific manifests though. This results in every file being thrown into a single compiled file. I need to break my site into separate manifests, and I don't want to have to add them individually. I'd rather have a single folder where my manifests live and where I know they will be precompiled. – Undistraction Nov 13 '12 at 15:17
  • Okay, look at the linked question, I think that solves it for you. – Sven Koschnicke Nov 13 '12 at 15:23