Bug:新建作业时菜单栏第一个显示蓝色,应该是第二个显示蓝色

This commit is contained in:
yanxd 2014-03-29 10:47:37 +08:00
parent 6e065361b3
commit 8c251da25d
2 changed files with 5 additions and 7 deletions

View File

@ -28,7 +28,7 @@ class ProjectsController < ApplicationController
# menu_item l(:label_homework), :only => :homework
# menu_item l(:label_course_feedback), :only => :feedback
menu_item :homework, :only => :homework
menu_item :homework, :only => [:homework, :new_homework]
menu_item :feedback, :only => :feedback
menu_item l(:label_course_file), :only => :index
menu_item l(:label_course_news), :only => :index

View File

@ -36,13 +36,11 @@ module ApplicationHelper
#Added by young
#Define the course menu's link class
# 不是数组的转化成数组然后判断当前menu_item是否在给定的列表
# REVIEW: 目测menu的机制貌似不是很需要转换再说
def link_class(label)
if current_menu_item == label
@class = 'selected'
else
@class = ''
end
return @class
labels = label.is_a?(Array) ? label : ([] << label)
labels.include?(current_menu_item) ? 'selected' : ''
end
#Ended by young
# Return true if user is authorized for controller/action, otherwise false