0
我一直在努力节省谁拥有多态关联一个对象,看看我的create_params
:态关联:API规范
module Admin
class ChatroomsController < AdminController # :nodoc:
...
def create_params
ActiveModelSerializers::Deserialization.jsonapi_parse!(
params,
only: [:name, :chatable],
polymorphic: [:chatable]
)
end
end
end
当发送保存时,AMS没有找到一种方法解决型号名称:
#<NameError: wrong constant name disputes>
如何保存具有多态关联的对象?谢谢。
拿我的整个堆栈掠夺https://gist.github.com/brunowego/33da32291a05a486f512965b2c41134c –