Method: Manageable::Helpers::FormBuilder#check_box

Defined in:
lib/manageable/helpers/form_builder.rb

#check_box(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object



85
86
87
88
89
90
91
92
93
# File 'lib/manageable/helpers/form_builder.rb', line 85

def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
  options[:class] = [options[:class], "checkbox"].compact.join(" ")
  label_tag = label(method, options.delete(:label), :class => "checkbox")
  label_tag = @@field_with_errors_proc.call(method, label_tag, @object, @template)

  @template.(:div) do
    (super(method, options, checked_value, unchecked_value) + label_tag).html_safe
  end
end