Search code examples
ruby-on-railsckeditorasset-pipeline

Rails 5 ckeditor gem not referencing compiled asset names


I am trying to use the ckeditor gem in a Rails 5 app. I added the compile path to config/initializers/assets.rb:

Rails.application.config.assets.precompile += Ckeditor.assets

I can see that it does properly compile. The problem is, in production, I get 404 errors (works fine in development):

Failed to load resource: the server responded with a status of 404 :assets/ckeditor/config.js?t=GB8C:1 

This tells me that the ckeditor gem is referencing the hard coded asset name, and not the digest named asset. Is there a workaround for this?

Thanks for any help, Kevin


Solution

  • I faced the same problem a long time ago and ended up using this gem github.com/alexspeller/non-stupid-digest-assets to skip the digest for ckeditor's assets (and I do the same with other gems that need assets too). It's not the best solution, but for me that I never change ckeditor assets the digest is not really needed.