Commit e7bca1c8 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Check current_controller against controller_path

The controller_path includes namespaces, where controller_name only includes the class name without controller
parent da6d9607
...@@ -13,7 +13,9 @@ module ApplicationHelper ...@@ -13,7 +13,9 @@ module ApplicationHelper
# current_controller?(:commits) # => false # current_controller?(:commits) # => false
# current_controller?(:commits, :tree) # => true # current_controller?(:commits, :tree) # => true
def current_controller?(*args) 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 end
# Check if a particular action is the current one # Check if a particular action is the current one
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment