Reputation: 102
I use the ckeditor gem. Everything has worked in the last time, after I copied ckeditor-files to public-folder. But after an assets precompile all of a sudden ckeditor disappeared (again) in both, development and production.
ckeditor.js with "CKEDITOR_BASEPATH = '/assets/ckeditor'" is successfully included in the header of my html-output, but the textarea is not shown.
The server log says:
Served asset /ckeditor/skins/kama/editor.css - 404 Not Found (5ms)
But it's there in both: app/assets/ckeditor/skins and app/public/assets/ckeditor/skins.
Soooooo
I tried changing to moono skin, since that's delivered with the gem. However, I can't get my customized app/assets/ckeditor/config.js file to be compiled. app/public/assets/ckeditor/config.js just always looks different. I deleted it and re-compiled, it's broken again. Any ideas? Thanks a lot!
Upvotes: 0
Views: 1237
Reputation: 102
I'm still not sure about the problem's origin. Solved it, however.
After moving my ckeditor files from app/assets/ckeditor to app/assets/javascripts/ckeditor, it started precompiling them again, which is great, because after that I was able to use my config.js. I also had some strange leftover ckeditor files in public/assets, which I had to delete. I wonder why updating from Rails 3.2 to 3.2.11 seems to have made my asset pipeline just ignore the folder in app/assets.
Second thing: to then use these precompiled files, it seems, it wasn't enough to mention them in application.js manifest. Instead, I put the following into the header of application.html.erb:
<script type="text/javascript">var CKEDITOR_BASEPATH = '/assets/ckeditor';</script>
<% if controller.action_name == 'edit' then %>
<%= javascript_include_tag "/assets/ckeditor/config", "/assets/ckeditor/init" %>
<% end %>
So, now it works. Good luck everybody!
Upvotes: 0