1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Recognize current tab with String#starts_with? instead of regexp

This commit is contained in:
Dimko 2013-05-07 19:00:44 +04:00
parent d56f9cdbac
commit 0991e649c7

View file

@ -5,13 +5,12 @@
ul.nav
- tabs.each do |title, url|
- if url == ''
li class="#{(current_path == url) ? 'active':''}"
a href='#{{root_path}}#{{url}}' = t(title)
li class="#{current_path == url ? 'active' : ''}"
a href="#{{root_path}}#{{url}}" = t(title)
- else
li class="#{(current_path =~ Regexp.new(url)) ? 'active':''}"
a href='#{{root_path}}#{{url}}' = t(title)
li class="#{current_path.starts_with?(url) ? 'active' : ''}"
a href="#{{root_path}}#{{url}}" = t(title)
- custom_tabs.each do |title, url|
li class="#{(current_path =~ Regexp.new(url)) ? 'active':''}"
a href='#{{root_path}}#{{url}}' = t(title)
li class="#{current_path.starts_with?(url) ? 'active' : ''}"
a href="#{{root_path}}#{{url}}" = t(title)