Bug:新建作业时菜单栏第一个显示蓝色,应该是第二个显示蓝色
This commit is contained in:
parent
6e065361b3
commit
8c251da25d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue