Module: Bizarroids::Settings::OptionsHelper

Defined in:
app/helpers/bizarroids/settings/options_helper.rb

Instance Method Summary collapse

Instance Method Details

#bizarroids_settings_input_options(custom_options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'app/helpers/bizarroids/settings/options_helper.rb', line 2

def bizarroids_settings_input_options custom_options={}
  key = @option.sym_key
  {
    label: @option.human_name,
    required: @option.required,
    input_html: { class: Bizarroids::Settings.options[key][:input_class] },
    collection: @option.collection? ? bizarroids_settings_select_collection(key) : nil
  }.merge custom_options
end

#bizarroids_settings_select_collection(key) ⇒ Object



12
13
14
# File 'app/helpers/bizarroids/settings/options_helper.rb', line 12

def bizarroids_settings_select_collection key
  Bizarroids::Settings.options[key][:collection]
end