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

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Dynamic Method Handling

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

Instance Method Details

#build(name, choices, selection, options = {}) ⇒ Object

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



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

def build(name, choices, selection, options={})
  options.reverse_merge!(class: nil, submit: false, translate: true)

  choices = get_choices(choices, options[:translate])

  return select_tag(name, options_for_select(choices, selection), generate_attributes(options))
end