本地版新建班级报500

This commit is contained in:
cxt 2016-10-09 16:11:34 +08:00
parent 2cc2d8e562
commit 9f72539845
2 changed files with 6 additions and 4 deletions

View File

@ -24,7 +24,7 @@ class Course < ActiveRecord::Base
end end
end end
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id, :end_time, :end_term
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier #belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表 belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -96,7 +96,9 @@ class Course < ActiveRecord::Base
'class_period', 'class_period',
'open_student', 'open_student',
'is_delete', 'is_delete',
'syllabus_id' 'syllabus_id',
'end_time',
'end_term'
acts_as_customizable acts_as_customizable

View File

@ -39,8 +39,8 @@
<div class="cl"></div> <div class="cl"></div>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"new_end_time"} %> <%= select_tag :end_time,options_for_select(course_time_option(@course[:end_time]),@course[:end_time]), {:id=>"new_end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"new_end_term"} %> <%= select_tag :end_term,options_for_select(course_term_option,@course[:end_term] || cur_course_term),{:id=>"new_end_term"} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则与开始学期保持一致。</span> <span class="mr15 c_red">仅针对跨越多个学期的班级,否则与开始学期保持一致。</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>