diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-17 14:22:43 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-17 14:22:43 +0200 |
commit | e7bca1c8535f0bdcde6293a560d87a452265d2c3 (patch) | |
tree | d86409ae923a1ebccba21346699bad7f6ad1570b | |
parent | da6d9607d1b997de19af94f9ff1bf58610f7f4ff (diff) | |
download | gitlab-ce-e7bca1c8535f0bdcde6293a560d87a452265d2c3.tar.gz |
Check current_controller against controller_path
The controller_path includes namespaces, where controller_name only includes the class name without controller
-rw-r--r-- | app/helpers/application_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b049bd9fcc2..39ab83ccf12 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -13,7 +13,9 @@ module ApplicationHelper # current_controller?(:commits) # => false # current_controller?(:commits, :tree) # => true def current_controller?(*args) - args.any? { |v| v.to_s.downcase == controller.controller_name } + args.any? do |v| + v.to_s.downcase == controller.controller_name || v.to_s.downcase == controller.controller_path + end end # Check if a particular action is the current one |