Skip to content

Rich text editor for Spree with Image and File uploading in-place.

License

Notifications You must be signed in to change notification settings

FG-IT/spree_editor

This branch is 7 commits ahead of, 3 commits behind spree-contrib/spree_editor:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

May 24, 2022
83d8363 · May 24, 2022
Nov 5, 2020
May 24, 2022
Jan 11, 2015
Oct 18, 2019
Oct 20, 2020
Mar 26, 2021
Oct 20, 2020
Dec 15, 2013
Oct 29, 2017
Jul 27, 2017
Jan 25, 2015
Jan 12, 2015
Jan 12, 2015
Oct 20, 2020
Oct 22, 2019
Jan 25, 2015
Jul 27, 2017
Feb 16, 2014
Jan 11, 2015
Mar 19, 2018
Jan 31, 2017
Jul 30, 2021

Repository files navigation

Spree Editor

Build Status Code Climate

This extension provides an inline rich-text editor for Spree. It implements different types of editors:

Please note that this extension is just a simple integration of some pretty complex gems: ckeditor and tinymce-rails.

If you have issues, please check their issues trackers first.


  1. Add this extension to your Gemfile with this line:

Spree >= 3.1

gem 'spree_editor', github: 'spree-contrib/spree_editor'

Spree 3.0 and Spree 2.x

gem 'spree_editor', github: 'spree-contrib/spree_editor', branch: 'X-X-stable'

The branch option is important: it must match the version of Spree you're using. For example, use 3-0-stable if you're using Spree 3-0-stable or any 3.0.x version.

  1. Install the gem using Bundler:
bundle install
  1. Copy & run migrations
bundle exec rails g spree_editor:install
  1. If using CKEditor, and would like to enable file uploads run the ckeditor generator:
$ rails g ckeditor:install --orm=active_record --backend=paperclip && rake db:migrate
  1. In order to secure your file uploads to only be accessed by admins you will also need to configure config/initializers/ckeditor.rb:
config.authorize_with :cancan, Spree::Ability
  1. In order to precompile CKEditor's generated assets, you will need to add a line in config/initializers/assets.rb:
Rails.application.config.assets.precompile += %w( ckeditor/*)
  1. Restart your server

If your server was running, restart it so that it can find the assets properly.


Configuration

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'
}

Language-Support

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.


Contributing

See corresponding guidelines


Copyright (c) 2010-2015 divineforest and other contributors, released under the New BSD License

About

Rich text editor for Spree with Image and File uploading in-place.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 83.3%
  • HTML 15.1%
  • Other 1.6%