lib/generators/dry_crud/templates/app/helpers/standard_helper.rb
# Transform the given text into a form as used by labels or table headers.
Transform the given text into a form as used by labels or table headers.
Transform the given text into a form as used by labels or table headers .
def captionize(text, clazz = nil)
    text = text.to_s
    if clazz.respond_to?(:human_attribute_name)
      clazz.human_attribute_name(text.end_with?('_ids') ? text[0..-5].pluralize : text)
    else
      text.humanize.titleize
    end
  end
def captionize ( text , clazz = nil ) text = text . to_s if clazz . respond_to? ( :human_attribute_name ) clazz . human_attribute_name ( text . end_with? ( '_ids' ) ? text [ 0 .. - 5 ] . pluralize : text ) else text . humanize . titleize end end
Transform the given text into a form as used by labels or table headers.
Transform the given text into a form as used by labels or table headers .
text
clazz