Module: Decidim::Admin::FeatureSettingsHelper

Defined in:
decidim-admin/app/helpers/decidim/admin/feature_settings_helper.rb

Overview

This class contains helpers needed in order for feature settings to properly render.

Constant Summary collapse

TYPES =
{
  boolean: :check_box,
  integer: :number_field,
  string: :text_field,
  text: :text_area
}.freeze

Instance Method Summary collapse

Instance Method Details

#settings_attribute_input(form, attribute, name, options = {}) ⇒ Object

Public: Renders a form field that matches a settings attribute’s type.

form - The form in which to render the field. attribute - The FeatureSettings::Attribute instance with the

description of the attribute.

name - The name of the field. options - Extra options to be passed to the field helper.

Returns a rendered form field.



25
26
27
# File 'decidim-admin/app/helpers/decidim/admin/feature_settings_helper.rb', line 25

def settings_attribute_input(form, attribute, name, options = {})
  form.send(TYPES[attribute.type.to_sym], name, options)
end