module TabHelper

Public Instance Methods

branches_tab_class() click to toggle source
# File app/helpers/tab_helper.rb, line 80
def branches_tab_class
  if current_page?(branches_project_repository_path(@project)) ||
    current_controller?(:protected_branches) ||
    current_page?(project_repository_path(@project))
    'active'
  end
end
project_tab_class() click to toggle source
# File app/helpers/tab_helper.rb, line 70
def project_tab_class
  [:show, :files, :edit, :update].each do |action|
    return "active" if current_page?(controller: "projects", action: action, id: @project)
  end

  if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
   "active"
  end
end