mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
- adds handling for when the returned resource is not serializable via ams - fix for when resource is an Array - Moves grape include to grape namespace. Changes Enumerable to Array because a plain hash is enumerable. - Add integration test - Refine scope of Grape version dependency - Assert that the response is equal to a manually defined JSON string - Add single module to include in Grape projects - Create a Serializable Resource to test rails-api from Grape - Update docs - Fix discrepency between ActiveRecord 4.0 - 4.1 and 4.2 - Updated Changelog - Remove parens from `render`, use `serializable` in all tests.
689 B
689 B
Integration with Grape
Grape is an opinionated micro-framework for creating REST-like APIs in ruby.
ActiveModelSerializers currently supports Grape >= 0.13, < 1.0
To add Grape support, enable the formatter and helper functions by including Grape::ActiveModelSerializers in your base endpoint. For example:
module Example
class Dummy < Grape::API
require 'grape/active_model_serializers'
include Grape::ActiveModelSerializers
mount Example::V1::Base
end
end
Aside from this, configuration of ActiveModelSerializers is exactly the same.