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



16
17
18
19
20
# File 'lib/lev/form_builder.rb', line 16

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



28
29
30
# File 'lib/lev/form_builder.rb', line 28

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



22
23
24
25
26
# File 'lib/lev/form_builder.rb', line 22

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