refactory projectController#new

exceptionHandle
yanxd 12 years ago
parent a101be344c
commit 5fb29c150b

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

Loading…
Cancel
Save