Class: Api::RolesController
Instance Method Summary
collapse
#user_name_params
#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
#attach ⇒ Object
16
17
18
19
|
# File 'app/controllers/api/roles_controller.rb', line 16
def attach
@user.attach! role, @course
head :ok
end
|
#create ⇒ Object
10
11
12
13
14
|
# File 'app/controllers/api/roles_controller.rb', line 10
def create
@user = User.create_if_necessary(user_params)
@user.attach! role, @course
render json: @user
end
|
#detach ⇒ Object
21
22
23
24
|
# File 'app/controllers/api/roles_controller.rb', line 21
def detach
@user.detach! role, @course
head :ok
end
|