diff options
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bee323993a0..6db813d4a02 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -296,4 +296,13 @@ module ApplicationHelper def page_class "issue-boards-page" if current_controller?(:boards) end + + # Returns active css class when condition returns true + # otherwise returns nil. + # + # Example: + # %li{ class: active_when(params[:filter] == '1') } + def active_when(condition) + 'active' if condition + end end |