Class: Api::OrganizationsController
Instance Method Summary
collapse
#ensure_base_organization!
#organization_name, #set_current_organization!, #visit_organization!
#authorization_slug, #authorize_janitor!, #authorize_owner!, #protection_slug
Instance Method Details
#create ⇒ Object
16
17
18
19
|
# File 'app/controllers/api/organizations_controller.rb', line 16
def create
@organization.save_and_notify!
render json: @organization.as_platform_json
end
|
#index ⇒ Object
8
9
10
|
# File 'app/controllers/api/organizations_controller.rb', line 8
def index
render json: { organizations: Organization.accessible_as(current_user, :janitor) }
end
|
#show ⇒ Object
12
13
14
|
# File 'app/controllers/api/organizations_controller.rb', line 12
def show
render json: @organization.as_platform_json
end
|
#update ⇒ Object
21
22
23
24
25
|
# File 'app/controllers/api/organizations_controller.rb', line 21
def update
@organization.update_and_notify! organization_params
render json: @organization.as_platform_json
end
|