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
-
t(‘view.CONTROLLER.MODEL.COL_NAME’)
-
MODEL.human_attribute_name(COL_NAME)
-
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 |