about summary refs log tree commit diff stats
path: root/app/controllers/blogs_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/blogs_controller.rb')
-rw-r--r--app/controllers/blogs_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 5e72601..f31287b 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb
@@ -2,6 +2,9 @@ class BlogsController < ApplicationController
2 2
3 def show 3 def show
4 @blog = Blog.find_by_slug(params[:slug]) 4 @blog = Blog.find_by_slug(params[:slug])
5
6 raise ActiveRecord::RecordNotFound unless @blog
7 raise ActiveRecord::RecordNotFound unless @blog.published or user_signed_in?
5 end 8 end
6 9
7end 10end