Class: Forms::FormsHelper::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
app/helpers/forms/forms_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(field, prefix, template) ⇒ FormBuilder

Returns a new instance of FormBuilder.



3
4
5
6
7
8
9
# File 'app/helpers/forms/forms_helper.rb', line 3

def initialize(field, prefix, template)
  if ActionPack::VERSION::STRING >= "4.0.0"
    super(prefix, field, template, {})
  else
    super(prefix, field, template, {}, nil)
  end
end

Instance Method Details

#required_field_checkboxObject



11
12
13
14
15
# File 'app/helpers/forms/forms_helper.rb', line 11

def required_field_checkbox
  @template.(:label, :class => "required") do
    check_box(:required, :id => nil) + " This field is required"
  end
end