about summary refs log tree commit diff stats
path: root/app/controllers
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-11 16:25:37 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-11 16:25:37 -0400
commit5f860c66d300654934848aee1abe8e5c0d41836e (patch)
tree73c6deda7baa751279f7b4fb9a0f10572cf92f0f /app/controllers
parent192705645135aa20951d78949d7e49e4bad58974 (diff)
downloadthoughts-5f860c66d300654934848aee1abe8e5c0d41836e.tar.gz
thoughts-5f860c66d300654934848aee1abe8e5c0d41836e.tar.bz2
thoughts-5f860c66d300654934848aee1abe8e5c0d41836e.zip
Added blog archive
The path to blog posts is now "blog" instead of "says", btw.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/blogs_controller.rb2
-rw-r--r--app/controllers/blogs_controller.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/admin/blogs_controller.rb b/app/controllers/admin/blogs_controller.rb index ea2c46c..c6d0168 100644 --- a/app/controllers/admin/blogs_controller.rb +++ b/app/controllers/admin/blogs_controller.rb
@@ -13,7 +13,7 @@ class Admin::BlogsController < Admin::AdminController
13 @blog = Blog.find(params[:id]) 13 @blog = Blog.find(params[:id])
14 14
15 if @blog.published 15 if @blog.published
16 redirect_to blog_url(@blog.slug) 16 redirect_to blog_post_url(@blog.slug)
17 else 17 else
18 render layout: "application" 18 render layout: "application"
19 end 19 end
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index eda1bbb..c35a05d 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb
@@ -1,7 +1,11 @@
1class BlogsController < ApplicationController 1class BlogsController < ApplicationController
2 2
3 def index 3 def summary
4 @blogs = Blog.where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10) 4 @blogs = Blog.where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10)
5 end
6
7 def index
8 @blogs = Blog.where(published: true).order(published_at: :desc)
5 9
6 respond_to do |format| 10 respond_to do |format|
7 format.html 11 format.html