Method: Edgarj::AssocHelper#draw_belongs_to_label_sub

Defined in:
app/helpers/edgarj/assoc_helper.rb

#draw_belongs_to_label_sub(model, col_name, parent_model) ⇒ Object

  1. t(‘view.CONTROLLER.MODEL.COL_NAME’)

  2. MODEL.human_attribute_name(COL_NAME)

  3. else, parent.human_name is used.



125
126
127
128
129
130
131
132
# File 'app/helpers/edgarj/assoc_helper.rb', line 125

def draw_belongs_to_label_sub(model, col_name, parent_model)
  @controller_model ||= controller.send(:model)

  I18n.t(col_name,
      scope:    "view.#{controller_path}.#{@controller_model.name.underscore}",
      default:  model.human_attribute_name(col_name,
          default:  parent_model.human_name))
end