Module: FormCutter::ActionViewExtensions::FormHelper

Defined in:
lib/form_cutter/action_view_extensions/form_helper.rb

Instance Method Summary collapse

Instance Method Details

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



18
19
20
21
22
23
24
25
# File 'lib/form_cutter/action_view_extensions/form_helper.rb', line 18

def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")
  begin
    raise template_error if !template?(options) || caller.first.include?("/app/views/"+base_template_path(options))
    render(:template => template_file(object_name, method, options, :check_box), :locals => locals(object_name, method, :check_box, options))
  rescue ActionView::MissingTemplate
    super(object_name, method, clean_options(options), checked_value, unchecked_value)
  end
end

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



27
28
29
30
31
32
33
34
# File 'lib/form_cutter/action_view_extensions/form_helper.rb', line 27

def radio_button(object_name, method, tag_value, options = {})
  begin
    raise template_error if !template?(options) || caller.first.include?("/app/views/"+base_template_path(options))
    render(:template => template_file(object_name, method, options, :radio_button), :locals => locals(object_name, method, :radio_button, options))
  rescue ActionView::MissingTemplate
    super(object_name, method, tag_value, clean_options(options))
  end
end