From 0333f3e258026696af265f777f862e612bab1bd7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 13 Oct 2023 11:51:47 -0400 Subject: Tag links --- app/controllers/tags_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 7115d28..cf5d50b 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,5 +1,10 @@ class TagsController < ApplicationController + def show + @blogs = Blog.tagged_with(params[:name]).where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10) + render "blogs/summary" + end + def suggest @tags = ActsAsTaggableOn::Tag.pluck(:name).select do |tag| tag.starts_with? params[:term] -- cgit 1.4.1