新手问题 问一个问题 关于 validates 和 I18n 的

yune · June 28, 2015 · Last by yune replied at June 28, 2015 · 1392 hits

如果有很多项验证怎么办?要写很多遍“不能为空” ?有没有简洁的写法?

activerecord:
  models:
    user: "用户"
  attributes:
    user:
      name: "姓名"
      tel: "电话"
      job: "期望职位"
  errors:
    models:
      user:
        attributes:
          name:
            blank: "不能为空"
          tel:
            blank: "不能为空"
          job:
            blank: "不能为空"
You need to Sign in before reply, if you don't have an account, please Sign up first.