Class: Releaf::Settings::FormBuilder

Inherits:
Builders::FormBuilder show all
Defined in:
app/builders/releaf/settings/form_builder.rb

Instance Attribute Summary

Attributes inherited from Builders::FormBuilder

#template

Instance Method Summary collapse

Methods inherited from Builders::FormBuilder

#association_collection, #field, #field_attributes, #field_render_method_name, #field_type_method, #input_attributes, #input_wrapper_with_label, #normalize_field, #normalize_fields, #releaf_field, #releaf_fields, #render_field_by_options, #resource_fields, #sortable_column_name, #translate_attribute

Methods included from Builders::FormBuilder::Associations

#association_reflector, #field_type_add_nested, #field_type_remove_nested, #reflect_on_association, #relation_name, #releaf_association_fields, #releaf_belongs_to_association, #releaf_has_many_association, #releaf_has_many_association_attributes, #releaf_has_many_association_body, #releaf_has_many_association_field, #releaf_has_many_association_fields, #releaf_has_many_association_footer, #releaf_has_many_association_header, #releaf_has_one_association, #releaf_has_one_or_belongs_to_association, #releaf_item_field, #releaf_item_field_choices, #releaf_item_field_collection

Methods included from Builders::FormBuilder::BooleanFields

#releaf_boolean_field

Methods included from Builders::FormBuilder::FileFields

#releaf_file_field, #releaf_file_remove_button, #releaf_image_field

Methods included from Builders::FormBuilder::NumberFields

#releaf_number_field

Methods included from Builders::FormBuilder::RichtextFields

#releaf_richtext_field, #richtext_input_attributes, #richtext_options

Methods included from Builders::FormBuilder::I18nFields

#default_locale, #locales, #localization_switch, #localized_field, #releaf_link_i18n_field, #releaf_richtext_i18n_field, #releaf_text_i18n_field, #releaf_textarea_i18n_field

Methods included from Builders::FormBuilder::DateFields

#date_or_time_field, #date_or_time_field_input_attributes, #releaf_date_field, #releaf_datetime_field, #releaf_time_field

Methods included from Builders::FormBuilder::AssociatedSetField

#releaf_associated_set_content, #releaf_associated_set_field, #releaf_associated_set_item

Methods included from Builders::FormBuilder::TextFields

#releaf_email_field, #releaf_link_field, #releaf_password_field, #releaf_text_field, #releaf_textarea_field

Methods included from Builders::FormBuilder::Label

#label_attributes, #label_text, #releaf_label

Methods included from Builders::Base

#default_translation_scope, #html_escape, #icon, #layout_settings, #locale_options, #resource_title, #safe_join, #t, #tag, #template_variable, #translate_locale, #wrapper

Instance Method Details

#field_namesObject


2
3
4
# File 'app/builders/releaf/settings/form_builder.rb', line 2

def field_names
  [:value]
end

#render_valueObject


6
7
8
# File 'app/builders/releaf/settings/form_builder.rb', line 6

def render_value
  send(value_render_method_name, :value, options: { label: { label_text: value_label_text }})
end

#value_label_textObject


14
15
16
17
# File 'app/builders/releaf/settings/form_builder.rb', line 14

def value_label_text
  label_text = object.description
  label_text.present? ? t(label_text, scope: "settings") : translate_attribute(:value)
end

#value_render_method_nameObject


10
11
12
# File 'app/builders/releaf/settings/form_builder.rb', line 10

def value_render_method_name
  "releaf_#{object.input_type}_field"
end