socialforge/app/controllers/organizations_controller.rb

28 lines
694 B
Ruby
Raw Normal View History

class OrganizationsController < ApplicationController
2015-11-03 17:21:32 +08:00
layout 'base_org'
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
end
end