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

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