urlruby-on-rails-4asset-pipelinetextile

Hard coding Image URL with textile together with Rails 4 using Asset Pipeline


With the Rails Asset pipeline, it's not possible to do this:

<img src="image.png" alt="">

Because the image, is compiled, and it will be stored as:

image-62479f3c21618b18e96899029738d913.png

To overcome this server side, there are helpers. For Erb, image_tag will will make sure the image is served, for Sass usage there also helpers. But in my case, I enter this code in a wiki with textile, so I enter this in the website:

!assets/netxforge-view.png!

... which obsioulsy doesn't work. ( Of course, I could let the wiki system manage the image and reference it, but that's not my aim right now)

So, is there away (With javascript, I imagine) to let the image URL resolve to it's actual path in the public/assets folder?

Thank You.


Solution

  • Wow, didn't know this caused so-much fuzz in rails community, but it's understandable. The standing from the rails-core-sprockets people is also understandable. I chose to make a copy of the assets with a rails task as explain in the thread.

    https://github.com/rails/sprockets-rails/issues/49