Skip to content

Commit 736591c

Browse files
committed
Merge pull request #1144 from bacarini/master
Fix Markdown to adapters documentation
2 parents 479146c + 9aa237a commit 736591c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/general/adapters.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ resources in the `"included"` member when the resource names are included in the
2525
`include` option.
2626

2727
```ruby
28-
render @posts, include: ['authors', 'comments']
29-
# or
30-
render @posts, include: 'authors,comments'
28+
render @posts, include: ['authors', 'comments']
29+
```
30+
31+
or
32+
33+
```ruby
34+
render @posts, include: 'authors,comments'
3135
```
3236

3337
The format of the `include` option can be either a String composed of a comma-separated list of [relationship paths](http://jsonapi.org/format/#fetching-includes), an Array of Symbols and Hashes, or a mix of both.
@@ -91,11 +95,13 @@ ActiveModel::Serializer::Adapter.register(:special_adapter, MyAdapter)
9195

9296
### Looking up an adapter
9397

94-
| `ActiveModel::Serializer::Adapter.adapter_map` | A Hash of all known adapters { adapter_name => adapter_class } |
95-
| `ActiveModel::Serializer::Adapter.adapters` | A (sorted) Array of all known adapter_names |
96-
| `ActiveModel::Serializer::Adapter.lookup(name_or_klass)` | The adapter_class, else raises an `ActiveModel::Serializer::Adapter::UnknownAdapter` error |
97-
| `ActiveModel::Serializer::Adapter.adapter_class(adapter)` | delegates to `ActiveModel::Serializer::Adapter.lookup(adapter)` |
98-
| `ActiveModel::Serializer.adapter` | a convenience method for `ActiveModel::Serializer::Adapter.lookup(config.adapter)` |
98+
| Method | Return value |
99+
| :------------ |:---------------|
100+
| `ActiveModel::Serializer::Adapter.adapter_map` | A Hash of all known adapters `{ adapter_name => adapter_class }` |
101+
| `ActiveModel::Serializer::Adapter.adapters` | A (sorted) Array of all known `adapter_names` |
102+
| `ActiveModel::Serializer::Adapter.lookup(name_or_klass)` | The `adapter_class`, else raises an `ActiveModel::Serializer::Adapter::UnknownAdapter` error |
103+
| `ActiveModel::Serializer::Adapter.adapter_class(adapter)` | Delegates to `ActiveModel::Serializer::Adapter.lookup(adapter)` |
104+
| `ActiveModel::Serializer.adapter` | A convenience method for `ActiveModel::Serializer::Adapter.lookup(config.adapter)` |
99105

100106
The registered adapter name is always a String, but may be looked up as a Symbol or String.
101107
Helpfully, the Symbol or String is underscored, so that `get(:my_adapter)` and `get("MyAdapter")`

0 commit comments

Comments
 (0)