Class: AdminAssistant::MultiFormView::Builder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
lib/admin_assistant/form_view.rb

Defined Under Namespace

Classes: SubFormBuilder

Instance Method Summary collapse

Constructor Details

#initialize(object_name, object, template, options, proc) ⇒ Builder

Returns a new instance of Builder.



108
109
110
111
# File 'lib/admin_assistant/form_view.rb', line 108

def initialize(object_name, object, template, options, proc)
  super(object_name, object, template, options, proc)
  @sub_form_views = options[:sub_form_views]
end

Instance Method Details

#each_sub_formObject



113
114
115
116
117
118
119
120
# File 'lib/admin_assistant/form_view.rb', line 113

def each_sub_form
  @object.each_with_index do |obj, i|
    builder = SubFormBuilder.new(
      @object_name, obj, @template, @options, @proc, i
    )
    yield builder, @sub_form_views[i]
  end
end