Myles Cowper-Coles f2b71ed70e Making sure quill editor updates with has_many
What:

* adding an event listerner so when people add a 'has_many' relationship
the quill editor is initialized correctly on any fields;

Why:

* If you have a nested has_many attributes in active admin, the form
is not created until you click the 'Add New ObjectName' button. This
triggers a jQuery event called 'has_many_add:after' which you can use to
trigger the re init of the quill editor.
* 9a33a081c9/app/assets/javascripts/active_admin/lib/has_many.es6 (L52)
2018-09-25 14:57:33 +01:00
2017-10-15 22:54:41 +02:00
2017-10-15 22:54:41 +02:00
2017-10-15 22:54:41 +02:00
2017-10-15 22:54:41 +02:00
2017-10-15 22:54:41 +02:00
2017-10-15 22:54:41 +02:00
2017-10-15 22:54:41 +02:00

ActiveAdmin Quill Editor Gem Version

An Active Admin plugin to use Quill Rich Text Editor

screenshot

Install

  • Update your Gemfile: gem 'activeadmin_quill_editor' (and execute bundle)
  • Add at the end of your ActiveAdmin styles (app/assets/stylesheets/active_admin.scss):
@import 'activeadmin/quill_editor_input';
  • Add at the end of your ActiveAdmin javascripts (app/assets/javascripts/active_admin.js):
//= require activeadmin/quill_editor/quill
//= require activeadmin/quill_editor_input
  • Use the input with as: :quill_editor in Active Admin model conf

Why 2 separated scripts? In this way you can include a different version of quill editor if you like.

Options

data-options: permits to set quill 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: :quill_editor
      f.input :published
    end
    f.actions
  end

Toolbar buttons configuration:

f.input :description, as: :quill_editor, input_html: {data: {options: {modules: {toolbar: [['bold', 'italic', 'underline'], ['link']]}, placeholder: 'Type something...', theme: 'snow'}}}

Notes

  • Upload functions (Images, Documents, Files, etc.) are not implemented yet

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

MIT

Описание
No description provided
Readme 1,3 MiB
Languages
JavaScript 88.6%
Ruby 10%
HTML 0.7%
CSS 0.3%
Makefile 0.2%
Разное 0.1%