vol1ura/Sat_9am_5km

View on GitHub
app/views/admin/clubs/_form.html.arb

Summary

Maintainability
Test Coverage
# frozen_string_literal: true

active_admin_form_for [:admin, resource] do |f|
  f.semantic_errors(*f.object.errors.attribute_names)

  f.inputs do
    input :country
    input :name
    input :description, as: :quill_editor,
                        input_html: {
                          data: {
                            options: {
                              modules: {
                                toolbar: [
                                  %w[bold italic strike],
                                  %w[blockquote code-block],
                                  [{ list: 'ordered' }, { list: 'bullet' }],
                                  ['link'],
                                  ['clean']
                                ],
                              },
                              placeholder: 'Какой же классный клуб...',
                              theme: 'snow',
                            },
                          },
                        }
    input :logo, as: :file, input_html: { accept: 'image/jpeg,image/png' }
  end

  f.actions
end