Closed xiaok closed 9 years ago
If you have a project up I can try to help you. This is most likely a missing require
.
solved
@xiaok Care to elaborate?
same Problem! .. how to fix ?
I had gem 'active_model_serializers'
in my Gemfile which was using a version without this class in it (0.9.3
). Specifying the latest release (0.10.0.rc3
) fixed it: gem 'active_model_serializers', '>= 0.10.0.rc3'
@dblock @twetzel
I use ActiveModel::Serializer.serializer_for(model).new(model).serializable_hash
instead.
but this function can not use current_user
ActiveModel::SerializableResource.new(@user)
error: uninitialized constant ActiveModel::SerializableResource