Class: Aven::WorkspacesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_workspace, #current_workspace=

Methods included from ApplicationHelper

#aven_importmap_tags, #view_component

Instance Method Details

#switchObject

POST /workspaces/:id/switch



8
9
10
11
12
# File 'app/controllers/aven/workspaces_controller.rb', line 8

def switch
  workspace = current_user.workspaces.friendly.find(params[:id])
  self.current_workspace = workspace
  redirect_to after_switch_workspace_path, notice: "Switched to #{workspace.label}"
end