about summary refs log tree commit diff stats
path: root/app/controllers/blogs_controller.rb
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-13 12:16:18 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-13 12:16:18 -0400
commit27482983496cd0b8b6fa7dc943a1b05959735835 (patch)
treebc63dd51607917101d11e3ab8547808173885023 /app/controllers/blogs_controller.rb
parent0333f3e258026696af265f777f862e612bab1bd7 (diff)
downloadthoughts-27482983496cd0b8b6fa7dc943a1b05959735835.tar.gz
thoughts-27482983496cd0b8b6fa7dc943a1b05959735835.tar.bz2
thoughts-27482983496cd0b8b6fa7dc943a1b05959735835.zip
Nice pagination!
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 c35a05d..39a578a 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb
@@ -2,6 +2,9 @@ class BlogsController < ApplicationController
2 2
3 def summary 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 if not params[:page]
6 @main_page = true
7 end
5 end 8 end
6 9
7 def index 10 def index