From 619d034ebabf5ae91e90fc211346a784235099bf Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 22 Feb 2017 13:25:28 +0000 Subject: [PATCH] Don't error on anonymous users viewing content :| --- app/controllers/content_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index fc4c6454..471f8d23 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -31,7 +31,7 @@ class ContentController < ApplicationController 'content_type': content_type.name, 'content_owner': current_user.present? && current_user.id == @content.user_id, 'logged_in_user': current_user.present? - }) + }) if current_user respond_to do |format| format.html { render 'content/show', locals: { content: @content } }