ETagを生成
適応バージョン
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.2.1
- 7.0.0
説明
ETagを生成
使い方
etag(情報)
例
class InvoicesController < ApplicationController
etag { current_user&.id }
def show
# Etag will differ even for the same invoice when it's viewed by a different current_user
@invoice = Invoice.find(params[:id])
fresh_when etag: @invoice
end
end