add self to new project
This commit is contained in:
parent
34ea112161
commit
bf4a695d76
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue