@@ -63,9 +63,9 @@ when the resource names are included in the `include` option.
6363Including nested associated resources is also supported.
6464
6565``` ruby
66- render @posts , include: [' author' , ' comments' , ' comments.author' ]
66+ render json: @posts , include: [' author' , ' comments' , ' comments.author' ]
6767 # or
68- render @posts , include: ' author,comments,comments.author'
68+ render json: @posts , include: ' author,comments,comments.author'
6969```
7070
7171In addition, two types of wildcards may be used:
@@ -76,7 +76,7 @@ In addition, two types of wildcards may be used:
7676These can be combined with other paths.
7777
7878``` ruby
79- render @posts , include: ' **' # or '*' for a single layer
79+ render json: @posts , include: ' **' # or '*' for a single layer
8080```
8181
8282The format of the ` include ` option can be either:
@@ -94,15 +94,15 @@ The following would render posts and include:
9494It could be combined, like above, with other paths in any combination desired.
9595
9696``` ruby
97- render @posts , include: ' author.comments.**'
97+ render json: @posts , include: ' author.comments.**'
9898```
9999
100100##### Security Considerations
101101
102102Since the included options may come from the query params (i.e. user-controller):
103103
104104``` ruby
105- render @posts , include: params[:include ]
105+ render json: @posts , include: params[:include ]
106106```
107107
108108The user could pass in ` include=** ` .
0 commit comments