Class: Caisson::Helpers::Form::Builder::Field::Select

Inherits:
Base
  • Object
show all
Defined in:
lib/caisson/helpers/form/builder/field/select.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Caisson::Helpers::Form::Builder::Field::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Caisson::Helpers::Form::Builder::Field::Base

Instance Method Details

#buildObject

************************************************************************************* PUBLIC INSTANCE METHODS *************************************************************************************



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/caisson/helpers/form/builder/field/select.rb', line 9

def build
  @options.reverse_merge!(choices: nil, include_blank: false)

  choices = parse_choices @options[:choices]

  @options.delete(:choices)
  @options.delete(:include_blank)
  @options[:translate] = false

  Caisson::Helpers::Form::Field::Select.new(@core).build(field_name, choices, value, @options)
end