FIX: Harmonise category body class generation on server/client (#16967)

The server-side implementation had unintentionally changed to include `-{id}` at the end of the body class name. This change meant that the JS client was unaware of the class, and didn't remove it when navigating away from the category page.

This commit fixes the server-side implementation to match the client
This commit is contained in:
David Taylor
2022-06-01 18:18:20 +01:00
committed by GitHub
parent 08a8c27f16
commit 333c58dd05
2 changed files with 12 additions and 1 deletions

View File

@ -181,7 +181,7 @@ module ApplicationHelper
result = ApplicationHelper.extra_body_classes.to_a
if @category && @category.url.present?
result << "category-#{@category.url.sub(/^\/c\//, '').gsub(/\//, '-')}"
result << "category-#{@category.slug_path.join('-')}"
end
if current_user.present? &&