Class: DynamicScaffold::Form::Item::Block
- Defined in:
- lib/dynamic_scaffold/form/item/block.rb
Instance Attribute Summary
Attributes inherited from Base
#multiple, #name, #parent_item
Instance Method Summary collapse
-
#initialize(config, type, name, options = {}, &block) ⇒ Block
constructor
A new instance of Block.
- #render(view, form, classnames = nil) ⇒ Object
Methods inherited from Base
create, #default, #default_value, #errors, #extract_parameters, #if, #insert, #label, #label?, #needs_rendering?, #note, #notes?, #proxy, #proxy_field, #render_label, #render_notes, #type?, #unique_name, #unless
Constructor Details
#initialize(config, type, name, options = {}, &block) ⇒ Block
Returns a new instance of Block.
7 8 9 10 |
# File 'lib/dynamic_scaffold/form/item/block.rb', line 7 def initialize(config, type, name, = {}, &block) super(config, type, name, ) @block = block end |
Instance Method Details
#render(view, form, classnames = nil) ⇒ Object
12 13 14 |
# File 'lib/dynamic_scaffold/form/item/block.rb', line 12 def render(view, form, classnames = nil) view.instance_exec(form, self, classnames, &@block) end |