diff --git a/app/assets/stylesheets/comments.css b/app/assets/stylesheets/comments.css index 0e0966388..0cd204c34 100644 --- a/app/assets/stylesheets/comments.css +++ b/app/assets/stylesheets/comments.css @@ -39,6 +39,10 @@ .comment { inline-size: 100%; flex-wrap: wrap; + + &:target { + background-color: var(--color-selected); + } } .comment__body { diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 1b23c6839..a08a0d12c 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -5,7 +5,7 @@ class CommentsController < ApplicationController @comment = @splat.comments.create(comment_params) @comment.save - redirect_to splat_path(@splat) + redirect_to splat_path(@splat, anchor: "comment_#{@comment.id}") end private diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index f04cd89a4..fe05a6288 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,4 +1,4 @@ -