From 85de7c04ab66e8029d69b350fbfecd22a8673fc2 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 11 Oct 2023 12:26:55 -0400 Subject: Blog title links --- app/models/blog.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models') diff --git a/app/models/blog.rb b/app/models/blog.rb index c12d0dc..415167c 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -26,6 +26,10 @@ class Blog < ApplicationRecord body[0..(body.index("")-1)] end + def to_param + slug + end + private def set_draft_title if self.title.blank? and not self.published -- cgit 1.4.1