add self to new project

This commit is contained in:
alan snape 2016-12-30 14:47:16 +00:00
parent 34ea112161
commit bf4a695d76
1 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,6 @@ class ProjectsController < ApplicationController
def create
#Todo
project = Project.new()
project.content = params[:content]
project.name = params[:name]
@ -42,7 +41,10 @@ class ProjectsController < ApplicationController
project.updated_at = now
project.save!
# 将自己加入项目
pu = Project_user.new()
pu.project_id = project.id
pu.user_id = session[:user_id].to_i
pu.save!
render :json => {:code => 0}
end