Saturday, August 27, 2016

Ckeditor Gem

CKEditor:
CKEditor is a WYSIWYG text editor designed to simplify web content creation. It brings common word processing features directly to your web pages. Enhance your website experience with our community maintained editor.

Step 1:

add gem to gemfile 

gemfile

gem 'ckeditor_rails'

Step 2:

In Terminal

$ bundle install

Step 3:

 Include CKEditor javascript assets

app/assets/javascripts/user.js

//= require ckeditor-jquery

Step 4:
 Configure plugins, languages, and skins of CKEditor assets

config/initializers/assets.rb

Ckeditor::Rails.configure do |config|
  # default is nil for all languages, or set as %w[en zh]
  config.assets_languages = nil
  # default is nil for all plugins,
  # or set as white list: %w[image link liststyle table tabletools]
  # or set as black list: config.default_plugins - %w[about a11yhelp]
  config.assets_plugins = nil
  # default is nil for all skins, or set as %w[moono]
  config.assets_skins = nil
end

No comments:

Post a Comment