Module: Maglev::Form::Inputs::ImageField

Included in:
FormBuilder
Defined in:
app/lib/maglev/form/inputs/image_field.rb

Instance Method Summary collapse

Instance Method Details

#image_field(method, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'app/lib/maglev/form/inputs/image_field.rb', line 7

def image_field(method, options = {})
  attributes = field_attributes(method)

  @template.render(Maglev::Uikit::Form::ImageFieldComponent.new(
                     name: attributes[:name],
                     search_path: image_search_path(attributes, options),
                     options: image_field_options(method, attributes, options),
                     alt_text: options[:alt_text]
                   ))
end