Class: InvitesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#redirect_back_or_default

Methods included from PageLayoutHelper

#blank_container, #container_class, #fluid_layout, #header_title, #nav, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_title, #sidebar

Methods included from GitlabRoutingHelper

#activity_project_path, #edit_project_path, #edit_project_url, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #milestone_path, #project_builds_path, #project_commits_path, #project_files_path, #project_path, #project_pipelines_path, #project_snippet_url, #project_url, #runner_path, #runners_path, #toggle_subscription_path

Methods included from Gitlab::GonHelper

#add_gon_variables

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Instance Method Details

#acceptObject


11
12
13
14
15
16
17
18
19
# File 'app/controllers/invites_controller.rb', line 11

def accept
  if member.accept_invite!(current_user)
    label, path = source_info(member.source)

    redirect_to path, notice: "You have been granted #{member.human_access} access to #{label}."
  else
    redirect_back_or_default(options: { alert: "The invitation could not be accepted." })
  end
end

#declineObject


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/invites_controller.rb', line 21

def decline
  if member.decline_invite!
    label, _ = source_info(member.source)

    path =
      if current_user
        dashboard_projects_path
      else
        new_user_session_path
      end

    redirect_to path, notice: "You have declined the invitation to join #{label}."
  else
    redirect_back_or_default(options: { alert: "The invitation could not be declined." })
  end
end

#showObject


7
8
9
# File 'app/controllers/invites_controller.rb', line 7

def show

end