Similar to Integrating CKEditor with Rails 3.1 Asset Pipline
I am trying to integrate ckeditor
with my rails 3.2
application.
I have all ckeditor files copied under /app/assets/javascripts/ckeditor/*
.
I have the following lines in my application.js
and application.js
is included in my layout file:
//= require jquery
//= require jquery_ujs
//= require ckeditor/ckeditor
//= require_self
Taken it from the answer to Integrating CKEditor with Rails 3.1 Asset Pipline
I can understand that I need to add something like:
config.assets.precompile += your_files
to my development.rb
file so that all the ckeditor files are precompiled when the application is loaded.
Although I tried a couple of paths, non worked and I keep getting the following error:
Can someone please tell me the right regular expresion to include all files for precompile, please?
I encountered the same problem and found a solution.Go to the following Link: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Specifying_the_Editor_Path
<script type="text/javascript">
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
</script>
<%= javascript_include_tag "application" %>
you don't need to set config.assets.precompile anything.
rails 3.2 fix:
... blablabla ... //= require ckeditor_fix #- add this line //= require ckeditor/init //= require_tree .
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
I used this guide to add ckeditor to activeadmin in Rails 3.2 with the asset pipeline enabled: https://github.com/gregbell/active_admin/wiki/CKEditor-integration
It worked like a charm.
The only additional thing I did was add this line to my environment:
config.assets.precompile += ['active_admin.css', 'active_admin.js', 'ckeditor/init.js']
Note that many of these answers refer to the ckeditor gem ( https://github.com/galetahub/ckeditor/ ), not just the ckeditor project ( http://ckeditor.com ) especially where you see reference to the ckeditor/init.js file.
There are other gems for ckeditor integration, including ckeditor-rails ( https://github.com/tsechingho/ckeditor-rails ) which is a lighter weight, simpler solution.
See also Integrating CKEditor with Rails 3.1 Asset Pipline
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With