Add it to your Gemfile
gem 'activeadmin_ckeditor'
--------------------------------------------------------------------
Follow the instructions for galetahub/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, :as => :ckeditor
end
f.actions
end
--------------------------------------------------------------
I've also found it necessary to add to app/assets/stylesheets/active_admin.css.scss to fit it to on the form:
.cke_chrome {
width: 79.5% !important;
overflow: hidden;
}
-------------------------------------------------------------
index do
selectable_column
id_column
column :descrption.html_safe
column :body.html_safe
end
----------------------------------------------------------------
URL: https://github.com/activeadmin/activeadmin/wiki/Ckeditor-integration
No comments:
Post a Comment