Skip to content

Commit db3d294

Browse files
committed
Doc: update partial rendering with dots in name
Since rails#39164 extension are deprecated (shipped with Rails 6.1). And has been removed in Rails 7.0.
1 parent 68eade8 commit db3d294

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)