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.
63 64 65 |
# File 'lib/houston/boot/extensions/dsl.rb', line 63 def fields @fields end |
Class Method Details
.extended(view) ⇒ Object
65 66 67 |
# File 'lib/houston/boot/extensions/dsl.rb', line 65 def self.extended(view) view.instance_variable_set :@fields, [] end |
Instance Method Details
#add_field(label, &block) ⇒ Object
69 70 71 72 73 74 |
# File 'lib/houston/boot/extensions/dsl.rb', line 69 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
76 77 78 79 |
# File 'lib/houston/boot/extensions/dsl.rb', line 76 def reset! @fields = [] super end |