修复编辑作业提交返回错误信息时填入正确信息后异常bug

This commit is contained in:
z9hang 2014-05-13 20:29:16 +08:00
parent fcc5f220ce
commit 57a4f45cad
1 changed files with 3 additions and 2 deletions

View File

@ -715,13 +715,14 @@ class BidsController < ApplicationController
def update
@bid = Bid.find(params[:id])
@project = @bid.courses.first
if @bid.update_attributes(params[:bid])
flash[:notice] = l(:label_update_homework_succeed)
@project = Project.find(params[:course_id])
#@project = Project.find(params[:course_id])
redirect_to project_homework_path(@project)
else
@bid.safe_attributes = params[:bid]
render :action => 'edit'
render :action => 'edit', :layout =>'base_courses' ,:bid_id=>@bid.id,:project_id =>@project
end
end