forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Ckeditor integration
fraank edited this page Mar 19, 2012
·
12 revisions
To use CKEDitor in Active Admin, you need to do four things:
- Add Ckeditor to your Gemfile
gem 'ckeditor'
for rails 3.2 use this
gem "ckeditor", "3.7.0.rc3"
- Add the ckeditor stylesheet to active admin (in config/initializers/active_admin.rb)
config.register_javascript 'ckeditor/ckeditor.js'
- Change your form to a partial
ActiveAdmin.register User do
form :partial => "user_form"
- Add the ckeditor class to your input field in the partial (in _user_form.html.haml) (HAML style code)
= semantic_form_for [:admin, @user] do |f|
= f.input :description, :input_html => {:class => :ckeditor}
Presto! You're done :-)