Kieran Klaassen
Kieran Klaassen

Reputation: 2202

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?

Upvotes: 9

Views: 2526

Answers (1)

Kaworu
Kaworu

Reputation: 2246

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.

Upvotes: 9

Related Questions