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.

results matching ""

    No results matching ""