Class: PagesCore::Admin::FormBuilder
Instance Method Summary
collapse
#text_area, #text_field
#locale_direction, #locales_with_dir, #rtl_locale?, #rtl_locales
Methods inherited from FormBuilder
#image_file_field, #image_file_preview
#field_with_label, #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
17
18
19
20
21
22
23
|
# File 'app/helpers/pages_core/admin/form_builder.rb', line 17
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
31
32
33
34
35
|
# File 'app/helpers/pages_core/admin/form_builder.rb', line 31
def labelled_image_uploader(attribute, label_text = nil, options = {})
labelled_field(attribute, label_text, options) do |opts|
image_uploader(attribute, opts)
end
end
|
#labelled_rich_text_area(attribute, label_text = nil, options = {}) ⇒ Object
25
26
27
28
29
|
# File 'app/helpers/pages_core/admin/form_builder.rb', line 25
def labelled_rich_text_area(attribute, label_text = nil, options = {})
labelled_field(attribute, label_text, options) do |opts|
rich_text_area(attribute, opts)
end
end
|
#rich_text_area(attr, options = {}) ⇒ Object
9
10
11
12
13
14
15
|
# File 'app/helpers/pages_core/admin/form_builder.rb', line 9
def rich_text_area(attr, options = {})
@template.rich_text_area_tag(
"#{object_name}[#{attr}]",
object.send(attr),
localized_form_field_options(attr).merge(options)
)
end
|