Class: Kiss::Form::FileField

Inherits:
Field show all
Defined in:
lib/kiss/form/field.rb

Constant Summary

Constants inherited from Field

Kiss::Form::Field::CURRENCY_SYMBOLS

Instance Method Summary collapse

Methods inherited from Field

#add_error, #content_tag_html, #debug, #errors_html, #html, #initialize, #input_tag_html, #method_missing, #param, #reset, #set_value_to_hash, #set_value_to_object, #table_row_html, #tag_html, #tag_start_html, #tip_html, #type, #value, #value_string, #value_to_s

Constructor Details

This class inherits a constructor from Kiss::Form::Field

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kiss::Form::Field

Instance Method Details

#element_html(attrs = {}) ⇒ Object



512
513
514
# File 'lib/kiss/form/field.rb', line 512

def element_html(attrs = {})
  input_tag_html(attrs) + tip_html(attrs)
end

#get_file_dataObject



518
# File 'lib/kiss/form/field.rb', line 518

def get_file_data; end

#get_file_nameObject



516
# File 'lib/kiss/form/field.rb', line 516

def get_file_name; end

#require_value(enter_verb) ⇒ Object



520
521
522
523
# File 'lib/kiss/form/field.rb', line 520

def require_value(enter_verb)
  p = param
  return add_error("Please choose #{label.downcase}.") unless p && p[:type]
end

#validateObject



525
526
527
# File 'lib/kiss/form/field.rb', line 525

def validate
  require_value(nil) if @_required
end