Class: Campo::Form
Constant Summary collapse
- DEFAULT =
{ method: "POST" }
Instance Attribute Summary
Attributes inherited from Base
#attributes, #attributes The element's html attributes., #fields, #fields The element's child elements.
Attributes included from Childish
Instance Method Summary collapse
-
#initialize(name, attributes = {}) ⇒ Form
constructor
A new instance of Form.
Methods inherited from Base
#each, #labelled, #on_output, #output, output, quotable, unhash
Methods included from Convenience
#bit_of_ruby, #checkbox, #fieldset, #hidden, #input, #literal, #password, #radio, #select, #submit, #text, #textarea
Methods included from Iding
Methods included from Childish
Constructor Details
#initialize(name, attributes = {}) ⇒ Form
Returns a new instance of Form.
442 443 444 445 446 447 |
# File 'lib/campo/campo.rb', line 442 def initialize(name, attributes={} ) super( name, DEFAULT.merge( attributes ) ) self.on_output do |n=0, tab=2| %Q!#{" " * n * tab}%form{ atts[:#{name.gsub(/\W/, "_").downcase}], #{Base.unhash( @attributes )} }! end end |