Class: Adva::View::Form
- Inherits:
-
Minimal::Template
- Object
- Minimal::Template
- Adva::View::Form
show all
- Includes:
- Tabs
- Defined in:
- lib/adva/view/form.rb,
lib/adva/view/form/tabs.rb
Defined Under Namespace
Modules: Tabs
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Tabs
#form_for, #simple_form_for, #tab, #with_tabs
Instance Attribute Details
Returns the value of attribute form.
7
8
9
|
# File 'lib/adva/view/form.rb', line 7
def form
@form
end
|
Instance Method Details
25
26
27
28
29
|
# File 'lib/adva/view/form.rb', line 25
def button_group
content_tag(:div, :class => 'buttons') do
buttons
end
end
|
31
32
33
|
# File 'lib/adva/view/form.rb', line 31
def buttons
form.button :submit
end
|
#fields ⇒ Object
43
44
|
# File 'lib/adva/view/form.rb', line 43
def fields
end
|
21
22
23
|
# File 'lib/adva/view/form.rb', line 21
def form_arguments
[resources]
end
|
13
14
15
16
17
18
19
|
# File 'lib/adva/view/form.rb', line 13
def form_tag
simple_form_for(*form_arguments) do |form|
@form = form
fields
button_group
end
end
|
#pass_return_to ⇒ Object
39
40
41
|
# File 'lib/adva/view/form.rb', line 39
def pass_return_to
hidden_field_tag :return_to, params[:return_to] if params[:return_to].present?
end
|
#return_here ⇒ Object
35
36
37
|
# File 'lib/adva/view/form.rb', line 35
def return_here
hidden_field_tag :return_to, request.url
end
|
#to_html ⇒ Object
9
10
11
|
# File 'lib/adva/view/form.rb', line 9
def to_html
form_tag
end
|