Created
June 8, 2015 06:14
-
-
Save GriffinHeart/1930b65b966a6acec1f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'active_model_serializers', github: 'rails-api/active_model_serializers', branch: '0-10-stable' | |
class Item | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
end | |
def index | |
render json: Item.all | |
end | |
----- | |
Failure/Error: get 'index' | |
NoMethodError: | |
undefined method `new' for nil:NilClass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since there is no
serializer
for the classItem
this line https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model/serializer/array_serializer.rb#L17 will be nil