Nami-Doc/Sprockets-PHP — pull request #29 by eric1234 (2014-03-06 02:46:03+00:00)
Title: Remove CSS filter

I'm do think this pull request is really the right code. But it's what I needed to do to get things working. The CSS filter is not useful to me. I am guessing it is an attempt to translate something like:

url('my-image.png')

Into something like

url('common/assets/images/my-image.png')

I.E. it provides the path to the location in the asset pipeline. This assumes of course that all paths in the asset pipeline are publicly accessible. I think this is a big assumption. The common case in the Rails world is that this is not true.

In addition I am actually getting absolute urls. I.E. more like

url('/home/eric/Dropbox/Development/Contracting/my-project/src/images/my-image.png')

This is obviously not publically resolvable by the browser. So my current solution is to simply remove the module. But obviously it was added for a purpose. So you may be looking for a different patch.

I think the right solution is actually for the developer to use the PHP filter. I.E. the developer names the file style.css.scss.php. The file then contains:

background-image: url()

I.E. custom PHP handles for cases where the developer wants the path to resolve to some other publicly accessible path that is part of the asset pipeline.

My suggestion is that this patch be accepted until someone else can either provide a more robust implementation OR it is decided that we leave it to PHP code that is specific to a projects needs if something like this is needed.