4 ms·
The only issue that's been biting me when using ActiveModel::Serializers and AngularJS is that we must manually return the json with the root: false option set,
by janus 13y ago
The only issue that's been biting me when using ActiveModel::Serializers and AngularJS is that we must manually return the json with the root: false option set, otherwise the AngularJS $resource provider doesn't work correctly.
- lentil 13y agoIf it helps you can make that the default for all your serializers, by doing something like this in an initializer: ActiveSupport.on_load(:active_model_serializers) do ActiveModel::ArraySerializer.root = false ActiveModel::Serializer.root = false end