优化代码

This commit is contained in:
z9hang 2014-05-14 09:35:44 +08:00
parent 57a4f45cad
commit da37a12158
1 changed files with 2 additions and 2 deletions

View File

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