Skip to content

Commit 8fdfe5b

Browse files
Bastiensteveklabnik
authored andcommitted
Fix subtab highlight error
Happened when another tab started with the same letters. Example: * test * test_bug (current)
1 parent a3b675a commit 8fdfe5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/resque/server.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def current_section
2626
url_path request.path_info.sub('/','').split('/')[0].downcase
2727
end
2828

29+
def current_subtab
30+
url_path request.path_info.sub('/','').split('/')[0, 2].join('/').downcase
31+
end
32+
2933
def current_page
3034
url_path request.path_info.sub('/','')
3135
end
@@ -40,7 +44,7 @@ def path_prefix
4044
end
4145

4246
def class_if_current(path = '')
43-
'class="current"' if current_page[0, path.size] == path
47+
'class="current"' if [current_section, current_subtab].include?(path)
4448
end
4549

4650
def tab(name)

0 commit comments

Comments
 (0)