Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4 selective asset digest

I want to specify which asset file names get a digest and which are not. Can I do this and how?

I need this functionality because I will use one asset on an external website and this URL needs to be the same.

What is the best solution to this problem?

like image 225
Kieran Klaassen Avatar asked Jul 22 '13 21:07

Kieran Klaassen


1 Answers

All files get digested. In Rails 3 all files also had a copy without digest but this was removed in Rails 4. Now you're supposed to have non digested assets in /public. A workaround is to create a rake task which copies the assets. More details can be found in https://github.com/rails/sprockets-rails/issues/49 in there is also a monkey patch to restore the old behavior.

like image 90
Kaworu Avatar answered Oct 19 '22 21:10

Kaworu