]> git.openstreetmap.org Git - rails.git/commitdiff
Remove slashes from body css classes
authorAnton Khorev <tony29@yandex.ru>
Sat, 4 Jan 2025 10:23:22 +0000 (13:23 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 8 Jan 2025 19:11:28 +0000 (22:11 +0300)
app/helpers/application_helper.rb

index fcf253289ea45ff65e11f0f30c5909146bfa1f10..ff6dcd2ff194820556e8a85382f97677ddd97d30 100644 (file)
@@ -37,7 +37,8 @@ module ApplicationHelper
     if content_for? :body_class
       content_for :body_class
     else
-      "#{params[:controller]} #{params[:controller]}-#{params[:action]}"
+      controller_part = params[:controller].tr("/", "-")
+      "#{controller_part} #{controller_part}-#{params[:action]}"
     end
   end