Class: Formidable::Elements::Form
- Inherits:
-
ElementList
- Object
- BasicElement
- ElementList
- Formidable::Elements::Form
- Defined in:
- lib/formidable/elements.rb
Constant Summary
Constants included from Rendering
Rendering::RendererNotAssigned
Instance Attribute Summary
Attributes inherited from BasicElement
#attributes, #cleaned_data, #content, #name, #raw_data, #tag
Attributes included from Rendering
Instance Method Summary collapse
-
#initialize(action, method = "POST", prefix = nil, attributes = Hash.new, raw_data = Hash.new) ⇒ Form
constructor
TODO: prefix should be in the form definition (name or namespace).
- #save(*args) ⇒ Object (also: #save!)
- #setup ⇒ Object
- #update(*args) ⇒ Object (also: #update!)
Methods inherited from ElementList
#cleaned_data, #content, #elements, #raw_data, #raw_data=, register, #set_prefix
Methods included from GroupValidations
#before_validate, #errors, register_validation, #valid?, #validate, #validations
Methods included from Rendering
Constructor Details
#initialize(action, method = "POST", prefix = nil, attributes = Hash.new, raw_data = Hash.new) ⇒ Form
TODO: prefix should be in the form definition (name or namespace)
124 125 126 127 128 129 130 |
# File 'lib/formidable/elements.rb', line 124 def initialize(action, method = "POST", prefix = nil, attributes = Hash.new, raw_data = Hash.new) @raw_data = raw_data self.setup super(:form, nil, attributes.merge!(action: action, method: method), raw_data) set_prefix(prefix) if prefix self.raw_data = raw_data end |
Instance Method Details
#save(*args) ⇒ Object Also known as: save!
136 137 138 |
# File 'lib/formidable/elements.rb', line 136 def save(*args) raise NotImplementedError, "You have to redefine this method in subclasses!" end |
#setup ⇒ Object
132 133 134 |
# File 'lib/formidable/elements.rb', line 132 def setup raise NotImplementedError, "You are supposed to redefine the setup method in subclasses of Element!" end |
#update(*args) ⇒ Object Also known as: update!
141 142 143 |
# File 'lib/formidable/elements.rb', line 141 def update(*args) raise NotImplementedError, "You have to redefine this method in subclasses!" end |