if current_path.split('?')[0] == tags_console_tickets_path
klass = scope == "tags_all" ? "current" : nil
else
klass = ((params[:scope] and params[:scope] == scope.to_s) or (params[:scope].blank? and scope.to_s == "unclosed_and_assigned_me_and_last_replied_not_me")) ? "current" : nil
end
老大review后
klass = \
if request.path == tags_consile_tickets_path
"current" if scope.to_s == "tags_all"
elsif params[:scope].present?
"current" if params[:scope] == scope.to_s
else
"current" if scope.to_s == "unclosed_and_assigned_me_and_last_replied_not_me"
end
然后我在来
klass = \
if request.path == tags_console_tickets_path
# tags_all
"current" if scope == :tags_all
elsif params[:scope].present?
# status, assigner, tags etc..
"current" if scope.to_s == params[:scope]
end