vol1ura/Sat_9am_5km

View on GitHub
app/views/admin/events/_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 :active
    input :country, include_blank: false
    input :name
    input :code_name if resource.new_record?
    input :town
    input :place
    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 :main_picture_link
    input :slogan
    input :visible_order, input_html: { inputmode: 'numeric' }
  end

  f.actions
end