Class: Aurita::GUI::File_Field
- Inherits:
-
Form_Field
- Object
- Element
- Form_Field
- Aurita::GUI::File_Field
- Defined in:
- lib/aurita-gui/form/file_field.rb
Overview
Usage:
Like Input_Field, but skipping attribute @value, as file input fields do not support default values (for good reason).
i = File_Field.new(:name => :the_file,
:label => 'Choose file')
Instance Attribute Summary
Attributes inherited from Form_Field
#form, #hidden, #label, #required, #type, #value
Attributes inherited from Element
#attrib, #content, #parent, #tag, #type
Instance Method Summary collapse
- #element ⇒ Object
-
#initialize(params) ⇒ File_Field
constructor
A new instance of File_Field.
Methods inherited from Form_Field
#disable!, #disabled=, #editable!, #enable!, #hidden?, #hide!, #optional!, #readonly!, #readonly=, #readonly?, #readonly_element, #required!, #required?, #show!, #to_hidden_field, #to_s
Methods inherited from Element
#+, #[], #[]=, #clear_floating, #dom_id, #dom_id=, #each, #empty?, #id, #id=, #length, #method_missing, #string, #to_ary
Constructor Details
#initialize(params) ⇒ File_Field
Returns a new instance of File_Field.
17 18 19 20 21 22 |
# File 'lib/aurita-gui/form/file_field.rb', line 17 def initialize(params) params[:tag] = :input params[:type] = :file unless params[:type] params.delete(:value) super(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Aurita::GUI::Element
Instance Method Details
#element ⇒ Object
23 24 25 |
# File 'lib/aurita-gui/form/file_field.rb', line 23 def element HTML.input(@attrib) end |