Module: Houston::Extensions::HasForm
- Defined in:
- lib/houston/boot/extensions/dsl.rb
Defined Under Namespace
Classes: Field
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
62 63 64 |
# File 'lib/houston/boot/extensions/dsl.rb', line 62 def fields @fields end |
Class Method Details
.extended(view) ⇒ Object
64 65 66 |
# File 'lib/houston/boot/extensions/dsl.rb', line 64 def self.extended(view) view.instance_variable_set :@fields, [] end |
Instance Method Details
#add_field(label, &block) ⇒ Object
68 69 70 71 72 73 |
# File 'lib/houston/boot/extensions/dsl.rb', line 68 def add_field(label, &block) Chain(AbilityBlock, Field.new(label).tap do |field| field.instance_variable_set :@render_block, block @fields << field end) end |
#reset! ⇒ Object
75 76 77 78 |
# File 'lib/houston/boot/extensions/dsl.rb', line 75 def reset! @fields = [] super end |