Skip to content

Commit 4697613

Browse files
committed
Add conditional GET for snippet show
1 parent 289f429 commit 4697613

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/controllers/share/snippets_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def index
1212
# GET /snippets/1
1313
def show
1414
@snippet = Snippet.find(params[:id])
15+
16+
fresh_when(@snippet, public: true) unless user_signed_in?
1517
end
1618

1719
# GET /snippets/new

0 commit comments

Comments
 (0)