There are several possible answers, depending on what you want. I do not quite understand what you are asking.
If it's in the app / assets, you really need something there to go through the asset pipeline in order to be accessible. In production, you need to pre-assemble all your assets that are part of the asset market and, if necessary, recompile them in production mode.
If the asset name does not have the scss
or sass
, it will not go through the scss / sass compiler, although it will still go through the asset pipeline for the fingerprints in the file name, gzipping, etc.
If you really do not want any asset to go through the asset pipeline, you cannot put it in app/assets
. You must put it in public
. Then the question arises, how to generate the URL, it is best to use public_path + "/subdir/foo.css"
.
But I'm not sure what you are asking. If you have an asset file that refers to an image path, usually you need this through the asset pipeline, absolutely! Because it is an asset pipeline that will correctly fill in the URLs for these image assets. You will want to use the Rails attribute helper in the asset file to create the URL for the image. You can put .erb
at the end of the file and then use the ERB codes <%= asset_path('my_asset.css') %> in it it. Or if it sass,
<%= asset_path('my_asset.css') %> in it it. Or if it sass,
asset_path` can be built into rails sass already, I forgot.
I donβt quite understand what the problem is that you are facing, but I think that what you are asking for may actually not be what you need. Have you checked the Rails Asset Pipeline manual? This is pretty decent. http://guides.rubyonrails.org/asset_pipeline.html
source share