I'm trying to figure out, whether I should be using config.assets.prefix
in my development environment or not.
When I'm using localhost, for development, are there any (dis-)advantages of doing this? When the local server itself isn't caching and is on another domain (production-domain vs localhost), I fail to see the disadvantages? Especially for hard-coding some paths in CSS and Javascript, which will then always return 404's on development..
I've been using config.assets.prefix = "/dev-assets"
as pr. reccomendation of another developer, who isn't working with us anymore.
Is this a problem, that anyone else have thought about and taken a standpoint at?
The biggest reason of using
config.assets.prefix
, emerges from the use of local asset precompilation. There are multiple reasons of precompiling locally and storing in source control. From http://guides.rubyonrails.org/asset_pipeline.html#local-precompilationBut if you use this, you will get into trouble in development mode because rails will serve your precompiled assets found in
/public/assets
. Therefore, you often setconfig.assets.prefix = '/dev-assets'
so you don't need to precompile every time you want to see effects of local changes in/app/assets
.