Skip to content

Commit

Permalink
fix typo caught by duduribeiro
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Dec 16, 2015
1 parent ce17a1b commit 51af5a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/general/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ when the resource names are included in the `include` option.
Including nested associated resources is also supported.

```ruby
render @posts, include: ['author', 'comments', 'comments.author']
render json: @posts, include: ['author', 'comments', 'comments.author']
# or
render @posts, include: 'author,comments,comments.author'
render json: @posts, include: 'author,comments,comments.author'

This comment has been minimized.

Copy link
@rromanchuk

rromanchuk Mar 21, 2017

I have no idea why, but this format does not work using the json adapter with json (2.0.3)

```

In addition, two types of wildcards may be used:
Expand All @@ -76,7 +76,7 @@ In addition, two types of wildcards may be used:
These can be combined with other paths.

```ruby
render @posts, include: '**' # or '*' for a single layer
render json: @posts, include: '**' # or '*' for a single layer
```

The format of the `include` option can be either:
Expand All @@ -94,15 +94,15 @@ The following would render posts and include:
It could be combined, like above, with other paths in any combination desired.

```ruby
render @posts, include: 'author.comments.**'
render json: @posts, include: 'author.comments.**'
```

##### Security Considerations

Since the included options may come from the query params (i.e. user-controller):

```ruby
render @posts, include: params[:include]
render json: @posts, include: params[:include]
```

The user could pass in `include=**`.
Expand Down

0 comments on commit 51af5a4

Please sign in to comment.