about summary refs log tree commit diff stats
path: root/app/controllers/admin
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/blogs_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/admin/blogs_controller.rb b/app/controllers/admin/blogs_controller.rb index 9706df3..1035c12 100644 --- a/app/controllers/admin/blogs_controller.rb +++ b/app/controllers/admin/blogs_controller.rb
@@ -9,6 +9,16 @@ class Admin::BlogsController < Admin::AdminController
9 @blogs = Blog.where(published: false).order(updated_at: :desc) 9 @blogs = Blog.where(published: false).order(updated_at: :desc)
10 end 10 end
11 11
12 def show
13 @blog = Blog.find(params[:id])
14
15 if @blog.published
16 redirect_to blog_url(@blog.slug)
17 else
18 render layout: "application"
19 end
20 end
21
12 def new 22 def new
13 @blog = Blog.new 23 @blog = Blog.new
14 end 24 end