Class: Neewom::AbstractField
- Inherits:
-
Object
- Object
- Neewom::AbstractField
- Defined in:
- lib/neewom/abstract_field.rb
Constant Summary collapse
- SUPPORTED_FIELDS =
This constant can be changed OUTSIDE !!!
[ # 'check_box_collection', EMAIL = 'email_field', HIDDEN = 'hidden_field', NUMBER = 'number_field', PASSWORD = 'password_field', PHONE = 'phone_field', # 'radio_button_collection', SELECT = 'select_field', MULTIPLE_SELECT = 'multiple_select_field', SUBMIT = 'submit', TEXTAREA = 'text_area', TEXT = 'text_field', CHECKBOX = 'checkbox', FILE = 'file', DATEPICKER = 'datepicker', TIMEPICKER = 'timepicker', DATETIMEPICKER = 'datetimepicker' ]
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#collection_klass ⇒ Object
Returns the value of attribute collection_klass.
-
#collection_method ⇒ Object
Returns the value of attribute collection_method.
-
#collection_params ⇒ Object
Returns the value of attribute collection_params.
-
#custom_options ⇒ Object
Returns the value of attribute custom_options.
-
#input ⇒ Object
Returns the value of attribute input.
-
#input_html ⇒ Object
Returns the value of attribute input_html.
-
#label ⇒ Object
Returns the value of attribute label.
-
#label_method ⇒ Object
Returns the value of attribute label_method.
-
#name ⇒ Object
Returns the value of attribute name.
-
#validations ⇒ Object
Returns the value of attribute validations.
-
#value_method ⇒ Object
Returns the value of attribute value_method.
-
#virtual ⇒ Object
Returns the value of attribute virtual.
Instance Method Summary collapse
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def collection @collection end |
#collection_klass ⇒ Object
Returns the value of attribute collection_klass.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def collection_klass @collection_klass end |
#collection_method ⇒ Object
Returns the value of attribute collection_method.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def collection_method @collection_method end |
#collection_params ⇒ Object
Returns the value of attribute collection_params.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def collection_params @collection_params end |
#custom_options ⇒ Object
Returns the value of attribute custom_options.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def @custom_options end |
#input ⇒ Object
Returns the value of attribute input.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def input @input end |
#input_html ⇒ Object
Returns the value of attribute input_html.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def input_html @input_html end |
#label ⇒ Object
Returns the value of attribute label.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def label @label end |
#label_method ⇒ Object
Returns the value of attribute label_method.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def label_method @label_method end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def name @name end |
#validations ⇒ Object
Returns the value of attribute validations.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def validations @validations end |
#value_method ⇒ Object
Returns the value of attribute value_method.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def value_method @value_method end |
#virtual ⇒ Object
Returns the value of attribute virtual.
24 25 26 |
# File 'lib/neewom/abstract_field.rb', line 24 def virtual @virtual end |
Instance Method Details
#build_collection(bind) ⇒ Object
68 69 70 71 72 |
# File 'lib/neewom/abstract_field.rb', line 68 def build_collection(bind) return collection if collection.present? Neewom::Collection.build_for_field(self, bind) end |
#build_validations ⇒ Object
56 57 58 |
# File 'lib/neewom/abstract_field.rb', line 56 def build_validations validations end |
#submit? ⇒ Boolean
28 29 30 |
# File 'lib/neewom/abstract_field.rb', line 28 def submit? input == SUBMIT end |