Class: AdminAssistant::MultiFormView
- Inherits:
-
Object
- Object
- AdminAssistant::MultiFormView
show all
- Includes:
- FormViewMethods
- Defined in:
- lib/admin_assistant/form_view.rb
Defined Under Namespace
Classes: Builder, RecordsForForm
Instance Method Summary
collapse
#action, #controller
Constructor Details
#initialize(records, admin_assistant, action_view) ⇒ MultiFormView
Returns a new instance of MultiFormView.
72
73
74
75
76
77
78
|
# File 'lib/admin_assistant/form_view.rb', line 72
def initialize(records, admin_assistant, action_view)
@records, @admin_assistant, @action_view =
records, admin_assistant, action_view
@sub_form_views = @records.map { |record|
AdminAssistant::FormView.new(record, @admin_assistant, @action_view)
}
end
|
Instance Method Details
#columns ⇒ Object
80
81
82
|
# File 'lib/admin_assistant/form_view.rb', line 80
def columns
@sub_form_views.first.columns
end
|
84
85
86
|
# File 'lib/admin_assistant/form_view.rb', line 84
def
@sub_form_views.first.
end
|
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/admin_assistant/form_view.rb', line 88
def form_for_args
opts = {
:builder => AdminAssistant::MultiFormView::Builder,
:sub_form_views => @sub_form_views, :url => {:action => action}
}
[
RecordsForForm.new(@records),
opts.merge(:as => @records.first.class.name.underscore.to_sym)
]
end
|
#submit_value ⇒ Object
99
100
101
|
# File 'lib/admin_assistant/form_view.rb', line 99
def submit_value
@sub_form_views.first.submit_value
end
|
#title ⇒ Object
103
104
105
|
# File 'lib/admin_assistant/form_view.rb', line 103
def title
@sub_form_views.first.title
end
|