Skip to content

Commit 9b07b1c

Browse files
committed
add the missing helper
1 parent f198663 commit 9b07b1c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/helpers/application_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ def localize(object, options = {})
8787

8888
alias l localize
8989

90+
def active_class(controller_name)
91+
if controller_name.is_a?(Array)
92+
'active' if controller_name.include?(controller.controller_name)
93+
else
94+
'active' if controller.controller_name == controller_name
95+
end
96+
end
97+
9098
private
9199

92100
def active_actions?(controller, actions)

0 commit comments

Comments
 (0)