This gem integrates the WYSIWYG JavaScript editor MediumEditor in Scrivito UI.
Add to Gemfile
:
gem 'scrivito-medium-editor', require: 'scrivito_medium_editor'
Add to app/assets/javascripts/application.js
after scrivito
:
//= require scrivito-medium-editor
Add to app/assets/stylesheets/application.css
after scrivito
:
/*
*= require scrivito-medium-editor
*/
Set the MediumEditor as the in-place editor when using scrivito_tag
:
<%= scrivito_tag :div, @obj, :body, data: {editor: :medium} %>
You can also override the toolbar options of the MediumEditor:
<%= scrivito_tag :div, @obj, :body, data: {editor: :medium,
medium_editor_toolbar: {buttons: %w[bold italic underline scrivito_anchor]}} %>
- Fork it ( https://github.com/kostia/scrivito-medium-editor/merge_tags/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request