Skip to content
Browse files

Fix subtab highlight error

Happened when another tab started with the same letters.

Example:
* test
* test_bug (current)
  • Loading branch information...
1 parent 4f366d3 commit f57fd17d5623c026ca6eea47be4b83a0ec017fce @basgys basgys committed with steveklabnik Aug 21, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/resque/server.rb
View
6 lib/resque/server.rb
@@ -26,6 +26,10 @@ def current_section
url_path request.path_info.sub('/','').split('/')[0].downcase
end
+ def current_subtab
+ url_path request.path_info.sub('/','').split('/')[0, 2].join('/').downcase
+ end
+
def current_page
url_path request.path_info.sub('/','')
end
@@ -40,7 +44,7 @@ def path_prefix
end
def class_if_current(path = '')
- 'class="current"' if current_page[0, path.size] == path
+ 'class="current"' if [current_section, current_subtab].include?(path)
end
def tab(name)

0 comments on commit f57fd17

Please sign in to comment.
Something went wrong with that request. Please try again.