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

exceptionHandle
z9hang 11 years ago
parent fcc5f220ce
commit 57a4f45cad

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

Loading…
Cancel
Save