Class: Caisson::Helpers::Form::Field::Base

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

Direct Known Subclasses

Checkbox, Password, Percent, Select, Text, Textarea

Instance Method Summary collapse

Constructor Details

#initialize(core) ⇒ Base

************************************************************************************* CONSTRUCTOR *************************************************************************************



9
10
11
# File 'lib/caisson/helpers/form/field/base.rb', line 9

def initialize(core)
  @core = core
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object (private)



35
36
37
38
39
40
41
# File 'lib/caisson/helpers/form/field/base.rb', line 35

def method_missing(*args, &block)
  if [:check_box_tag, :content_tag, :hidden_field_tag, :options_for_select, :password_field_tag, :select_tag, :text_area_tag, :text_field_tag].include?(args.first)
    return @core.send(*args, &block)
  else
    raise NoMethodError.new("undefined local variable or method '#{args.first}' for #{self.class}")
  end
end