Rails不会使用人名作为错误消息
在我的翻译文件中
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"
验证在subject_preference模型中完成。但页面上显示的错误是“主题偏好基础艺术优先级不能与科学优先级相同”。
如何正确显示型号名称?
更新:
我只是想摆脱“主题偏好基础”,我该怎么办呢?谢谢
errors[:base] << "Duplicated priority in science subject"
没有找到相关结果
已邀请:
1 个回复
倪蕊悲潍
在我的模型中:
此方法确保仅显示验证消息本身。