forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Ckeditor integration
JelleDekker edited this page Jul 30, 2012
·
12 revisions
Integration with Ckeditor using the galahub/ckeditor gem:
Follow the instructions for galahub/ckeditor (gem, mount in routes and rails generate for your file uploads if wanted), then add the following to /config/initializers/active_admin.rb
# To load a javascript file:
config.register_javascript 'ckeditor/init.js'
In your resource you'll need to add to your form:
form do |f|
f.inputs do
f.input :foo
f.input :bar, :input_html => {:class => "ckeditor"}
end
f.buttons
end
And your almost done, you can now use Ckeditor in active_admin, however everyone who manages to access Ckeditor can browse CKeditor uploads and add to them. galahub/Ckeditor has methods to restrict acces using CanCan, I advise you read through the documentation of CanCan integration both for Ckeditor and Active Admin to make this work.