From f2602e79306f348eb6c8b2a3e9b852c0cd6ee0d8 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 10 Dec 2024 17:50:25 -0500 Subject: Added convenience link for editing published blog posts --- app/views/blogs/show.html.haml | 2 ++ app/views/layouts/application.html.haml | 1 + 2 files changed, 3 insertions(+) (limited to 'app') diff --git a/app/views/blogs/show.html.haml b/app/views/blogs/show.html.haml index 7558257..32d44bd 100644 --- a/app/views/blogs/show.html.haml +++ b/app/views/blogs/show.html.haml @@ -6,3 +6,5 @@ .clear = render @blog, short: false = show_comments(@blog) +- content_for :meta_sidebar_content do + = link_to "Edit this post", edit_admin_blog_url(@blog.id) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ac338c7..90ea5e2 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -71,6 +71,7 @@ - if not user_signed_in? %li= link_to "Log in", new_user_session_path - if user_signed_in? + = yield :meta_sidebar_content %li= link_to "Admin", admin_url %li= link_to "Log out", destroy_user_session_path, method: :delete #main -- cgit 1.4.1