Class: Admin::Tramway::Landing::BlockForm

Inherits:
Tramway::Core::ExtendedApplicationForm
  • Object
show all
Defined in:
app/forms/admin/tramway/landing/block_form.rb

Instance Method Summary collapse

Constructor Details

#initialize(object = nil) ⇒ BlockForm

Returns a new instance of BlockForm.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/forms/admin/tramway/landing/block_form.rb', line 9

def initialize(object = nil)
  super(object).tap do
    form_properties page: :association,
                    title: :string,
                    background: :file,
                    position: {
                      type: :numeric,
                      input_options: {
                        hint: I18n.t('hints.tramway.landing.block.position', array: ::Tramway::Landing::Block.active.on_main_page.map(&:position).join(','))
                      }
                    },
                    block_type: :default,
                    navbar_link: :default,
                    anchor: :string,
                    description: :ckeditor,
                    button_title: :string,
                    button_link: :string,
                    view_name: :string
  end
end