File: grape.md

package info (click to toggle)
ruby-active-model-serializers 0.10.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,752 kB
  • sloc: ruby: 13,138; sh: 53; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Integration with Grape

[Grape](https://github.com/ruby-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](https://github.com/ruby-grape/grape) support, enable the formatter and helper functions by including `Grape::ActiveModelSerializers` in your base endpoint. For example:

```ruby
module Example
  class Dummy < Grape::API
    require 'grape/active_model_serializers'
    include Grape::ActiveModelSerializers
    mount Example::V1::Base
  end
end
```

Aside from this, [configuration](../general/configuration_options.md) of ActiveModelSerializers is exactly the same.