mirror of
https://github.com/samsonjs/grape-active_model_serializers.git
synced 2026-03-25 08:45:55 +00:00
Update readme to use full class names for serializer rather than the symbol #19
This commit is contained in:
parent
92a2a5ba82
commit
4bef8357df
1 changed files with 3 additions and 3 deletions
|
|
@ -85,18 +85,18 @@ end
|
|||
|
||||
```ruby
|
||||
# Serializer options can be specified on routes or namespaces.
|
||||
namespace 'foo', :serializer => :bar do
|
||||
namespace 'foo', :serializer => BarSerializer do
|
||||
get "/" do
|
||||
# will use "bar" serializer
|
||||
end
|
||||
|
||||
# Options specified on a route or namespace override those of the containing namespace.
|
||||
get "/home", :serializer => :home do
|
||||
get "/home", :serializer => HomeSerializer do
|
||||
# will use "home" serializer
|
||||
end
|
||||
|
||||
# All standard options for `ActiveModel::Serializers` are supported.
|
||||
get "/fancy_homes", :root => 'world', :each_serializer => :fancy_homes
|
||||
get "/fancy_homes", :root => 'world', :each_serializer => FancyHomesSerializer
|
||||
...
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue