Class: Api::OrganizationsController
Instance Method Summary
collapse
#ensure_base_organization!
#organization_name, #set_current_organization!, #visit_organization!
#bad_record, #blocked_forum, #disabled, #disabled_organization, #forbidden, #gone, #internal_server_error, #not_found, #render_error, #unauthorized, #unprepared_organization
Instance Method Details
#authorization_slug ⇒ Object
25
26
27
|
# File 'app/controllers/api/organizations_controller.rb', line 25
def authorization_slug
'_/_'
end
|
#create ⇒ Object
15
16
17
18
|
# File 'app/controllers/api/organizations_controller.rb', line 15
def create
@organization.save!
render json: @organization.to_resource_h
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/api/organizations_controller.rb', line 7
def index
render json: { organizations: Organization.accessible_as(current_user, :janitor) }
end
|
#show ⇒ Object
11
12
13
|
# File 'app/controllers/api/organizations_controller.rb', line 11
def show
render json: @organization.to_resource_h
end
|
#update ⇒ Object
20
21
22
23
|
# File 'app/controllers/api/organizations_controller.rb', line 20
def update
@organization.update! organization_params
render json: @organization.to_resource_h
end
|