ezedepetris / activeadmin_froala_editor

Froala WYSIWYG editor for ActiveAdmin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ActiveAdmin Froala Editor Gem Version

An Active Admin plugin to use Froala WYSIWYG editor (jQuery required, font-awesome required & included)

screenshot

For Froala license / pricing see Froala website.

Install

  • Update your Gemfile: gem 'activeadmin_froala_editor' (and execute bundle)
  • Add at the end of your ActiveAdmin styles (app/assets/stylesheets/active_admin.scss):
@import 'font-awesome/font-awesome';
@import 'activeadmin/froala_editor_input';
  • Add at the end of your ActiveAdmin javascripts (app/assets/javascripts/active_admin.js):
//= require activeadmin/froala_editor/froala_editor.pkgd.min
//= require activeadmin/froala_editor_input
  • Use the input with as: :froala_editor in Active Admin model conf

Why 2 separated scripts? In this way you can include a different version of froala editor if you like. The same for FontAwesome.

Options

data-options: permits to set froala editor options directly - see options list

Examples

# ActiveAdmin article form conf:
  form do |f|
    f.inputs 'Article' do
      f.input :title
      f.input :description, as: :froala_editor
      f.input :published
    end
    f.actions
  end

Toolbar buttons configuration:

f.input :description, as: :froala_editor, input_html: {data: {options: {toolbarButtons: ['undo', 'redo', '|', 'bold', 'italic']}}}

Notes

  • Code View function doesn't work properly with this plugin

  • For upload functions (Images, Documents, Files, etc.) see Froala docs

Do you like it? Star it!

If you use this component just star it. A developer is more motivated to improve a project when there is some interest.

Take a look at other ActiveAdmin components that I made if you are curious.

Contributors

License

Froala License: see Froala website

Plugin License: MIT

About

Froala WYSIWYG editor for ActiveAdmin

License:MIT License


Languages

Language:JavaScript 60.3%Language:CSS 39.5%Language:Ruby 0.2%