refactory projectController#new

This commit is contained in:
yanxd 2013-11-11 09:27:51 +08:00
parent a101be344c
commit 5fb29c150b
1 changed files with 16 additions and 10 deletions

View File

@ -485,18 +485,24 @@ class ProjectsController < ApplicationController
end
def new
@project_type = params[:project_type]
@course_tag = params[:course]
@project_type = params[:project_type]
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
@trackers = Tracker.sorted.all
##TODO: , viewed by nyan
##add by huang
@course=Course.new
@course.safe_attributes = params[:course]
##end
case @project_type
when '0' # Project
@project = Project.new
@project.safe_attributes = params[:project]
when '1' # Course
@project = Project.new
@project.safe_attributes = params[:project]
@course_tag = params[:course]
@course = Course.new
@course.safe_attributes = params[:course]
else
render_404
return -1
end
render :layout => 'base'
end