Class: DynamicScaffold::Form::Item::Block

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamic_scaffold/form/item/block.rb

Instance Attribute Summary

Attributes inherited from Base

#multiple, #name, #parent_item

Instance Method Summary collapse

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, options = {}, &block)
  super(config, type, name, options)
  @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