#1457 修复课程开课日期无法修改的BUG

优化选择开课时间代码
competition
sw 11 years ago
parent 4998420410
commit 7ec103e135

@ -63,6 +63,8 @@ class CoursesController < ApplicationController
#更新课程信息
def update
@course.safe_attributes = params[:course]
@course.time = params[:time]
@course.term = params[:term]
@course.class_period = params[:class_period]
if @course.save
if params[:course][:is_public] == '0'

@ -453,4 +453,31 @@ module CoursesHelper
Course.tagged_with(tag_name).order('updated_at desc')
end
#课程实践年份下拉框
def course_time_option
type = []
#work_types = WorksCategory.all
for i in (2008..2020)
option = []
option << i
option << i
type << option
end
type
end
#课程课时下拉框
def course_term_option
type = []
option1 = []
option1 << l(:label_spring)
option1 << l(:label_spring)
option2 = []
option2 << l(:label_autumn)
option2 << l(:label_autumn)
type << option1
type << option2
type
end
end

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save