summernote-ext-addclass-rails

The gemification of the summernote extension summernote-addclass for Rails >= 3.1.

Demo

Also, we have a live demo (check the CSS3 icon button).

Installation

Add the following gems to your application's Gemfile:

gem 'bootstrap-sass'   # required
gem 'summernote-rails' # required
gem 'summernote-ext-addclass-rails', '~> 0.8.10'

And then execute on the terminal:

bundle install

Usage

JavaScript

In app/assets/javascripts/application.js, you should add in this order:

//= require bootstrap
//= require summernote
//= require summernote-ext-addclass

CoffeeScript

In app/assets/javascripts/application.coffee, you should add in this order:

#= require bootstrap
#= require summernote
#= require summernote-ext-addclass

Customization

$('[data-provider="summernote"]').summernote({
  addclass: {
    debug: false,
    classTags: [
      { title: 'My Special style', value: 'kappa-css'},
      'text-muted',
      'text-primary'
    ]
  },
  height: 300,
  toolbar: [
    // ['groupName', ['list-of-button']]
    ['style', ['style', 'addclass', 'clear']],
    ['misc',  ['codeview', 'help']]
  ]
});

More information here.

Versioning

Major Minor Patch Current
is the major of summernote is the minor of summernote is the patch of summernote is the vesion of this extension

Example:

The compatible versions of this gem with summernote v0.8.10 are:

  • summernote-ext-image-attributes-rails v0.8.10.X

License

MIT