This gem integrates Medium Editor with Rails asset pipeline.
The latest version of Medium Editor bundled by this gem is 4.2.0
Include medium-editor-rails in your Rails project's Gemfile:
gem 'medium-editor-rails'
And then execute:
$ bundle install
Include javascript file in app/assets/javascripts/application.js:
//= require medium-editor
Include stylesheet file on app/assets/stylesheets/application.css:
*= require medium-editor/medium-editor
You can also include themes from themes folder, example:
*= require medium-editor/themes/flat
You need to initialize Medium Editor with any selector of div, example:
<div class="editable"></div>
<script>var editor = new MediumEditor('.editable');</script>
For extra options, visit this page:
https://github.com/daviferreira/medium-editor#initialization-options
- Fork it ( http://github.com/marjinal1st/medium-editor-rails/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 new Pull Request