Skip to content

Commit 1cb5b8d

Browse files
authored
Merge pull request rails#50881 from D-system/doc-no-extension-in-filename-render
Update caching_with_rails.md regarding extension in filename [ci skip]
2 parents 3295823 + db3d294 commit 1cb5b8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/caching_with_rails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ render(partial: 'hotels/hotel', collection: @hotels, cached: true)
191191

192192
Will load a file named `hotels/hotel.erb`.
193193

194-
Another option is to include the full filename of the partial to render.
194+
Another option is to include the `formats` attribute to the partial to render.
195195

196196
```ruby
197-
render(partial: 'hotels/hotel.html.erb', collection: @hotels, cached: true)
197+
render(partial: 'hotels/hotel', collection: @hotels, formats: :html, cached: true)
198198
```
199199

200200
Will load a file named `hotels/hotel.html.erb` in any file MIME type, for example you could include this partial in a JavaScript file.

0 commit comments

Comments
 (0)