新建课程不能提交

This commit is contained in:
cxt 2017-09-06 14:58:26 +08:00
parent 5f5c59f516
commit 478a88c09f
4 changed files with 3 additions and 4 deletions

View File

@ -1007,7 +1007,6 @@ class CoursesController < ApplicationController
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@course = Course.new
@course.safe_attributes = params[:course]
@syllabus = Syllabus.where("id = #{params[:syllabus_id].to_i}").first if params[:syllabus_id]
# month = Time.now.month
render :layout => 'new_base'

View File

@ -3,7 +3,7 @@
</div>
<div class="hwork_new pr">
<ul>
<%= labelled_form_for @course do |f| %>
<%= form_tag({:controller => 'courses', :action => 'create'}, :id => "new_course") do %>
<li class="mt5 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>
<% if @syllabus.nil? %>

View File

@ -3,7 +3,7 @@
</div>
<div class="hwork_new pr">
<ul>
<%= labelled_form_for @syllabus do |f| %>
<%= form_tag({:controller => 'syllabuses', :action => 'create'}, :id => "new_syllabus") do %>
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;课程名称&nbsp;&nbsp;</label>
<input type="text" name="title" id="new_syllabus_name" class="name_input" placeholder="例如:软件工程" maxlength="100" onkeyup="regex_syllabus_name();">

View File

@ -224,7 +224,7 @@ function submit_new_course()
{
if(regex_syllabus_option('new')&&regex_course_name('new')&&regex_course_class_period('new')&&regex_time_term('new'))
{
$(".new_course").submit();
$("#new_course").submit();
}
}