Class: Lev::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
lib/lev/form_builder.rb

Instance Method Summary collapse

Instance Method Details

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



14
15
16
17
18
# File 'lib/lev/form_builder.rb', line 14

def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
  options[:checked] = true if get_form_params_entry(method).to_i > 0
  mark_error_if_present(method, options)
  super(method, options, checked_value, unchecked_value)
end

#fields_for(record_name, record_object = nil, fields_options = {}, &block) ⇒ Object



26
27
28
# File 'lib/lev/form_builder.rb', line 26

def fields_for(record_name, record_object = nil, fields_options = {}, &block)
  raise "Didn't put fields_for into LevitateFormBuilder yet"
end

#radio_button(method, tag_value, options = {}) ⇒ Object



20
21
22
23
24
# File 'lib/lev/form_builder.rb', line 20

def radio_button(method, tag_value, options = {})
  options[:checked] = true if get_form_params_entry(method) == tag_value
  mark_error_if_present(method, options)
  super(method, tag_value, options)
end