Class: GenericFormFor::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Includes:
Helpers::ActionHelper, Helpers::ActionsHelper, Helpers::FieldsetHelper, Helpers::FormHelper, Helpers::InputHelper
Defined in:
lib/generic_form_for/form_builder.rb

Instance Attribute Summary collapse

Attributes included from Helpers::ActionsHelper

#args, #block

Attributes included from Helpers::FieldsetHelper

#args, #block

Attributes included from Helpers::FormHelper

#args, #autofocus, #proc, #record

Class Method Summary collapse

Methods included from Helpers::ActionsHelper

#actions

Methods included from I18n

#translate, #translate_action, #translate_hint, #translate_label, #translate_legend, #translate_placeholder

Methods included from Helpers::ActionHelper

#action

Methods included from Helpers::FieldsetHelper

#fieldset

Methods included from Helpers::InputHelper

#input

Methods included from Helpers::FormHelper

#generic_fields_for, #generic_form_for

Instance Attribute Details

#templateObject

Returns the value of attribute template.



4
5
6
# File 'lib/generic_form_for/form_builder.rb', line 4

def template
  @template
end

Class Method Details

.action_wrapper(&block) ⇒ Object

action_wrapper do

action_html

end

>

<input type=“submit” value=“Save”/>



107
108
109
# File 'lib/generic_form_for/form_builder.rb', line 107

def self.action_wrapper(&block)
  self.action_wrapper_proc = block
end

.actions_wrapper(&block) ⇒ Object

actions_wrapper do

actions_html

end

>

<div> </div>



94
95
96
# File 'lib/generic_form_for/form_builder.rb', line 94

def self.actions_wrapper(&block)
  self.actions_wrapper_proc = block
end

.configure(name, value = nil) ⇒ Object



6
7
8
9
# File 'lib/generic_form_for/form_builder.rb', line 6

def self.configure(name, value = nil)
  class_attribute(name)
  self.send(:"#{name}=", value)
end

.fieldset_wrapper(&block) ⇒ Object

fieldset_wrapper do

fieldset_html

end

>

<fieldset> </fieldset>

fieldset_wrapper do

fieldset_html :tag => "div", :class => "fieldset" do
  legend_html :tag => "span", :class => "legend"
end

end

>

<div class=“fieldset”>


</div>



62
63
64
# File 'lib/generic_form_for/form_builder.rb', line 62

def self.fieldset_wrapper(&block)
  self.fieldset_wrapper_proc = block
end

.form_wrapper(&block) ⇒ Object

form_wrapper do

form :class => "form-vertical"

end

>

<form class=“form-vertical” …> </form>



34
35
36
# File 'lib/generic_form_for/form_builder.rb', line 34

def self.form_wrapper(&block)
  self.form_wrapper_proc = block
end

.input_wrapper(&block) ⇒ Object

input_wrapper do

wrap_in :class => "controls" do 
  label_html
  input_html
  error_html
end

end

>

<div class=“controls” …>



can not be blank

</div>



80
81
82
# File 'lib/generic_form_for/form_builder.rb', line 80

def self.input_wrapper(&block)
  self.input_wrapper_proc = block
end