2015-11-03 11:19:38 +08:00
|
|
|
class OrganizationsController < ApplicationController
|
2015-11-03 17:21:32 +08:00
|
|
|
layout 'base_org'
|
2015-11-03 11:19:38 +08:00
|
|
|
def new
|
|
|
|
@organization = Organization.new
|
|
|
|
render :layout => 'new_base'
|
|
|
|
end
|
|
|
|
def create
|
|
|
|
@organization = Organization.new
|
|
|
|
@organization.name = params[:organization][:name]
|
|
|
|
@organization.description = params[:organization][:description]
|
|
|
|
@organization.is_public = params[:organization][:is_public]
|
|
|
|
@organization.creator_id = User.current.id
|
|
|
|
member = OrgMember.new(:user_id => User.current.id, :role => 'Manager')
|
|
|
|
@organization.org_members << member
|
2015-11-03 17:21:32 +08:00
|
|
|
if @organization.save
|
|
|
|
redirect_to organization_path(@organization)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
2015-11-03 11:19:38 +08:00
|
|
|
end
|
|
|
|
end
|