class PhantomForms::FormBuilders::ValidateFormBuilder

Constants

FORM_HELPERS

Public Class Methods

new(*) click to toggle source
Calls superclass method
# File lib/phantom_forms/form_builders/validate_form_builder.rb, line 11
def initialize(*)
  super
  @help_tag, @help_css = if options.fetch(:help, '').to_sym == :block
    [:p, 'help-block']
  else
    [:span, 'help-inline']
  end
end

Public Instance Methods

check_box(name, *args) click to toggle source
Calls superclass method
# File lib/phantom_forms/form_builders/validate_form_builder.rb, line 42
def check_box(name, *args)
  options = args.extract_options!.symbolize_keys!
  content_tag :div, class: "control-group#{(' error' if object.errors[name].any?)}"  do
    content_tag(:div, class: 'controls') do
      args << options.except(:label, :help)
      html = super(name, *args) + ' ' + options[:label]
      label(name, html, class: 'checkbox')
    end
  end
end