aboutsummaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index d80e4fe..c3c9b12 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -3,6 +3,14 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
module ApplicationHelper
+ # Set CSS classes on body tag
+ def body_classes(*args)
+ classes = args || []
+ classes << controller_name
+ classes << action_name
+ ' class="'.html_safe << classes.join(' ') << '"'.html_safe
+ end
+
# Markdown helper
# Always use all extensions. Additional parser and render options may be
# passed as a second argument.