我将_prefix
用于相同的枚举。
我的模特
enum relationship_status: [:All,:Married, :Single, :Engaged, :Divorced, :Widowed, :Separated, :Complicated], _prefix: :relationship_status
enum gender: [:All,:Male, :Female], _prefix: :gender
enum qualification: [:All,:Uneducated,:Matric, :Inter, :Graduation, :Masters, :PHD], _prefix: :qualification
它出错
undefined method `each_with_index' for :relationship_status:Symbol
我如何解决?