Class: Adva::View::Form

Inherits:
Minimal::Template
  • Object
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

#formObject (readonly)

Returns the value of attribute form.



7
8
9
# File 'lib/adva/view/form.rb', line 7

def form
  @form
end

Instance Method Details

#button_groupObject



25
26
27
28
29
# File 'lib/adva/view/form.rb', line 25

def button_group
  (:div, :class => 'buttons') do
    buttons
  end
end

#buttonsObject



31
32
33
# File 'lib/adva/view/form.rb', line 31

def buttons
  form.button :submit
end

#fieldsObject



43
44
# File 'lib/adva/view/form.rb', line 43

def fields
end

#form_argumentsObject



21
22
23
# File 'lib/adva/view/form.rb', line 21

def form_arguments
  [resources]
end

#form_tagObject



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_toObject



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_hereObject



35
36
37
# File 'lib/adva/view/form.rb', line 35

def return_here
  hidden_field_tag :return_to, request.url
end

#to_htmlObject



9
10
11
# File 'lib/adva/view/form.rb', line 9

def to_html
  form_tag
end