Class: InvitationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/invitations_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#login_button, #redirect_to_main_organization!, #should_choose_organization?, #should_redirect_to_main_organization?, #validate_accessible!

Methods included from Mumuki::Laboratory::Controllers::DynamicErrors

#forbidden, #gone, #internal_server_error, #not_found, #unauthorized

Methods included from Mumuki::Laboratory::Controllers::Notifications

#has_notifications?, #notifications_count, #user_notifications_path

Methods included from Mumuki::Laboratory::Controllers::Authorization

#authorization_slug, #from_sessions?

Methods included from Mumuki::Laboratory::Controllers::CurrentOrganization

#organization_name, #set_current_organization!, #visit_organization!

Instance Method Details

#authorize_if_private!Object



16
17
18
# File 'app/controllers/invitations_controller.rb', line 16

def authorize_if_private!
  # This controller must never be authenticated
end

#joinObject



9
10
11
12
13
14
# File 'app/controllers/invitations_controller.rb', line 9

def join
  current_user.accept_invitation! @invitation
  current_user.update! user_params
  current_user.notify!
  redirect_to_organization!
end

#showObject



5
6
7
# File 'app/controllers/invitations_controller.rb', line 5

def show
  redirect_to_organization! if current_user.student_of? @organization
end