I have a problem with asset preocompilation in Rails (3.2.7).
I am including an favicon like this:
You must tell Rails which assets are to be precompiled. You do this in config/application.rb
or config/environments/production.rb
with the config.assets.precompile config key.
Rails starts with a default list of assets to precompile, including ["application.js", "application.css"]
, but if you want your own assets to be precompiled too, you have to add them to the list.
For example:
# config/application.rb
module MyApp
class Application < Rails::Application
# other config ...
config.assets.precompile += ["screen.css", "*.png"]
end
end
Ok, after a couple of tries I figured out, how to fix this. Nevertheless it´s a little bit strange and does not satisfy me completely. It only worked for me, when I set digest
to true and provide the path to the manifest
:
config.assets.compile = false
config.assets.digest = true
config.assets.manifest = Rails.root.join("public/assets")
It would be interesting to know, what´s behind this "logic".