Module: Gaigo::FormHelper

Defined in:
lib/gaigo/helpers/form_helper_v3.rb,
lib/gaigo/helpers/form_helper_v4.rb

Instance Method Summary collapse

Instance Method Details

#ilabel(object_name, method, content_or_options = nil, options = nil, &block) ⇒ Object

module_eval <<-EOV



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gaigo/helpers/form_helper_v3.rb', line 8

def ilabel(object_name, method, content_or_options = nil, options = nil, &block)
  options ||= {}

  content_is_options = content_or_options.is_a?(Hash)
  if content_is_options || block_given?
    options.merge!(content_or_options) if content_is_options
    text = nil
  else
    text = content_or_options
  end

  ActionView::Helpers::InstanceTag.new(object_name, method, self, options.delete(:object)).to_ilabel_tag(text, options, &block)
end