Method: Formtastic::Inputs::Base::Naming#humanized_method_name

Defined in:
lib/formtastic/inputs/base/naming.rb

#humanized_method_nameObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/formtastic/inputs/base/naming.rb', line 22

def humanized_method_name
  if builder.label_str_method != :humanize
    # Special case where label_str_method should trump the human_attribute_name
    # TODO: is this actually a desired bheavior, or should we ditch label_str_method and
    # rely purely on :human_attribute_name.
    method.to_s.send(builder.label_str_method)
  elsif object && object.class.respond_to?(:human_attribute_name)
    object.class.human_attribute_name(method.to_s)
  else
    method.to_s.send(builder.label_str_method)
  end
end