Skip to content

Ckeditor integration

houen edited this page Jan 26, 2012 · 3 revisions

To use CKEDitor in Active Admin, you need to do four things:

  1. Add Ckeditor to your Gemfile
gem 'ckeditor'
  1. Add the ckeditor stylesheet to active admin (in config/initializers/active_admin.rb)
config.register_javascript 'ckeditor/ckeditor.js'
  1. Change your form to a partial
ActiveAdmin.register User do
  form :partial => "user_form"
  1. 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 :-)