문제

I'm using Rails 4 with latest ckeditor gem. All assets precompile nicely, except they aren't USED by ckeditor. The regular, uncompressed files are.

https://github.com/galetahub/ckeditor/issues/316
https://github.com/galetahub/ckeditor/issues/307

I ran the rake task, and the files are generated...however my server isn't...serving them.

http://www.mydomain.com/assets/ckeditor/config.js?t=D6IE < Fails
http://www.mydomain.com/assets/ckeditor/config.js < Works

Yet files uploaded via Paperclip, which have query strings in the URL but not the filename load just fine. What's the deal?

도움이 되었습니까?

해결책

Looking at the 2nd link, I just for the hell of it tried putting in config.assets.precompile += Ckeditor.assets into application.rb and it worked. Why? I don't know. You'd think this would be something that would be already inside the gem but...I guess not. I figured it wasn't an issue considering the ckeditor assets were precompiling to begin with. ckeditor still isn't using the precompiled assets, rather the assets supplied by the custom rake task, but at the very least it's causing the server to not issue 404 not found on the plain assets anymore.

다른 팁

I think that is the case when you have generated models with CKeditor.

For when you just need the editor, I've added to my application.rb file the following line:

config.assets.initialize_on_precompile = true
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top