about summary refs log tree commit diff stats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/blogs_controller.rb3
-rw-r--r--app/controllers/tags_controller.rb2
2 files changed, 4 insertions, 1 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
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index cf5d50b..bceb3cf 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb
@@ -1,8 +1,8 @@
1class TagsController < ApplicationController 1class TagsController < ApplicationController
2 2
3 def show 3 def show
4 @tag_name = params[:name]
4 @blogs = Blog.tagged_with(params[:name]).where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10) 5 @blogs = Blog.tagged_with(params[:name]).where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10)
5 render "blogs/summary"
6 end 6 end
7 7
8 def suggest 8 def suggest