新手问题 type 好像是保留字段,但前端用了 type 字段该怎么办

a-wing · February 09, 2018 · Last by bestjane replied at February 09, 2018 · 1294 hits

要在控制器里做一层转换??

前后分离,前端提交的 json 里有 type 字段

返回的数据也要有 type 字段。。。。。

怎么把这么常用的字段保留。。。。。。

有个 api 是改 sti 字段的(默认 type),查查文档

class User < ActiveRecord::Base
  self.inheritance_column = :_type_disabled
end
You need to Sign in before reply, if you don't have an account, please Sign up first.