This extension provides an inline rich-text editor for Open. It implements a rich text editor like TinyMCE.
Please note that this extension is just a simple integration of some pretty complex gem: tinymce-rails
, if you have issues, please check their issues trackers first.
It's best to use with Open Essential Content.
- Add Open Editor gem to your Gemfile with this line:
gem 'open_editor', github: '99cm/open_editor', branch: 'master'
- Install the gem using Bundler:
bundle install
- Copy & run migrations
bundle exec rails g open_editor:install
- Restart your server
If your server was running, restart it so that it can find the assets properly.
Preferences can be updated within the admin panel under "configuration" then "rich editor".
Or you may set them with an initializer within your application:
SpreeEditor::Config.tap do |config|
config.ids = 'product_description page_body event_body'
# change the editor to CKEditor
config.current_editor = 'CKEditor'
end
The default preference is:
{
enabled: true,
current_editor: 'TinyMCE',
ids: 'product_description page_body'
}
To obtain support for multiple languages with TinyMCE add tinymce-rails-langs to your Gemfile:
gem 'tinymce-rails-langs'
TinyMCE will not be loaded unless it finds a language package matching your Spree::Config.default_locale
.
Copyright (c) 2019 Leo Wang and other contributors, released under the New BSD License