ruby-grape / grape-active_model_serializers

User active_model_serializers with Grape
MIT License
140 stars 68 forks source link

can't use ActiveModel::SerializableResource #44

Closed xiaok closed 9 years ago

xiaok commented 9 years ago

ActiveModel::SerializableResource.new(@user)

error: uninitialized constant ActiveModel::SerializableResource

dblock commented 9 years ago

If you have a project up I can try to help you. This is most likely a missing require.

xiaok commented 9 years ago

solved

dblock commented 9 years ago

@xiaok Care to elaborate?

twetzel commented 9 years ago

same Problem! .. how to fix ?

shanet commented 9 years ago

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'

xiaok commented 9 years ago

@dblock @twetzel I use ActiveModel::Serializer.serializer_for(model).new(model).serializable_hash instead. but this function can not use current_user