lib/generators/dry_crud/templates/app/helpers/standard_helper.rb
def translate_association(key, assoc = nil, variables = {})
    primary = if assoc
      variables[:default] ||= [:"activerecord.associations.#{assoc.klass.model_name.underscore}.#{key}",
                               :"global.associations.#{key}"]
      :"activerecord.associations.models.#{assoc.active_record.model_name.underscore}.#{assoc.name}.#{key}"
    else
      :"global.associations.#{key}"
    end
    t(primary, variables)
  end
# Translates the passed key for an active record association. This helper is used
# for rendering association dependent keys in forms like :no_entry, :none_available or
# :please_select.
# The key is looked up in the following order:
#  - activerecord.associations.models.{model_name}.{association_name}.{key}
#  - activerecord.associations.{association_model_name}.{key}
#  - global.associations.{key}
Translates the passed key for an active record association. This helper is used
for rendering association dependent keys in forms like :no_entry, :none_available or
:please_select.
Translates the passed key for an active record association . This helper is used for rendering association dependent keys in forms like : no_entry : none_available or : please_select .
def translate_association(key, assoc = nil, variables = {})
    primary = if assoc
      variables[:default] ||= [:"activerecord.associations.#{assoc.klass.model_name.underscore}.#{key}",
                               :"global.associations.#{key}"]
      :"activerecord.associations.models.#{assoc.active_record.model_name.underscore}.#{assoc.name}.#{key}"
    else
      :"global.associations.#{key}"
    end
    t(primary, variables)
  end
def translate_association ( key , assoc = nil , variables = { } ) primary = if assoc variables [ :default ] ||= [ :" activerecord.associations. #{ assoc . klass . model_name . underscore } . #{ key } " , :" global.associations. #{ key } " ] :" activerecord.associations.models. #{ assoc . active_record . model_name . underscore } . #{ assoc . name } . #{ key } " else :" global.associations. #{ key } " end t ( primary , variables ) end
Translates the passed key for an active record association.
Translates the passed key for an active record association .
key
assoc
variables