Rails doesn't use human name for error message -


in translation file

activerecord:  models:    subject_choice: "subject choice"    subject_preference: "subject preference"    art_subject_choice: "group 1 preference"    science_subject_choice: "group 2 preference"   attributes:   student:     in_class: "class"   subject_prefernce:     math_preference_type:       m1: "m1"       m2: "m2"       m1_m2: "m1>m2"       m2_m1: "m2>m1"   subject:     subject_type:       science: "science"       art: "art"       elective: "elective" 

the validation done in subject_preference model. error show on page "subject preference base art priority cannot same science priority."

how can make display model name correctly?

update: want rid of "subject preference base", how can it? thanks

errors[:base] << "duplicated priority in science subject" 

i tried different approach, example

en:     activerecord:         models:             message:         attributes:             message:                 content: ""                 subject: "" 

and in model:

validates :subject, :presence => { :message => i18n.t('validation.category')} 

this approach ensures validation message shown.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -