Class: PagesCore::Admin::FormBuilder

Inherits:
FormBuilder
  • Object
show all
Includes:
DynamicImage::Helper
Defined in:
app/helpers/pages_core/admin/form_builder.rb

Instance Method Summary collapse

Methods inherited from FormBuilder

#field_with_label, #image_file_field, #image_file_preview, #label_and_errors, #label_for, #labelled_check_box, #labelled_country_select, #labelled_date_select, #labelled_datetime_select, #labelled_file_field, #labelled_image_file_field, #labelled_password_field, #labelled_select, #labelled_text_area, #labelled_text_field, #labelled_time_select

Instance Method Details

#image_uploader(attr, options = {}) ⇒ Object


6
7
8
9
10
11
12
# File 'app/helpers/pages_core/admin/form_builder.rb', line 6

def image_uploader(attr, options = {})
  @template.image_uploader_tag(
    "#{object_name}[#{foreign_key(attr)}]",
    object.send(attr),
    options
  )
end

#labelled_image_uploader(attribute, label_text = nil, options = {}) ⇒ Object


14
15
16
17
18
# File 'app/helpers/pages_core/admin/form_builder.rb', line 14

def labelled_image_uploader(attribute, label_text = nil, options = {})
  labelled_field(attribute, label_text, options) do |opts|
    image_uploader(attribute, opts)
  end
end