class event < ActiveRecord::Base
has_many :orders, dependent: :destroy
accepts_nested_attributes_for :orders, reject_if: :all_blank, allow_destroy: true
end
class order < ActiveRecord::Base
belongs_to :kinmu_keitai
validates :order_code, presence: true
end
当 event.save 的时候 order 的验证 rollback
错误信息
"Order order code必须入力"
请问这个 Order order code 需要在哪定义
想把错误信息的字段转成文字
在 yml 里定义好像不行
activerecord:
models:
order: "南北"
attributes:
order:
order_code: "北南"