Godmin Medium

Gem Version

Godmin Medium is a MediumEditor component for Godmin that adds an f.medium_area to forms.

Installation

Add the gem to the application's Gemfile:

gem "godmin-medium"

Or to the admin engine's gemspec:

s.add_dependency "godmin-medium", "~> 0.1.0"

Require it in your app/assets/javascripts/application.js, just after the require godmin line:

//= require godmin
//= require godmin-medium

And finally, do the same with your app/assets/stylesheets/application.css:

*= require godmin
*= require godmin-medium

Usage

Use the medium editor area in your form like so:

<%= form_for @resource do |f| %>
  <%= f.text_field :title %>
  <%= f.medium_area :body, {
    buttons: ['bold', 'italic', 'underline', 'strikethrough', 'quote', 'anchor']
  } %>
  <%= f.submit %>
<% end %>

Contributors

https://github.com/varvet/godmin-medium-editor/graphs/contributors

License

Godmin Medium is licensed under the MIT license. See the separate MIT-LICENSE file.