Class: Cased::CLI::SessionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/cased/cli/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#cancelObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/cased/cli/sessions_controller.rb', line 20

def cancel
  guard_session = Cased::CLI::Session.find(params[:guard_session_id])
  guard_session.cancel

  respond_to do |format|
    format.html do
      safe_redirect_back
    end

    format.json do
      render partial: 'cased/cli/sessions/guard_session', locals: { guard_session: guard_session }
    end
  end
end

#showObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/cased/cli/sessions_controller.rb', line 6

def show
  guard_session = Cased::CLI::Session.find(params[:guard_session_id])

  respond_to do |format|
    format.html do
      render partial: 'cased/cli/sessions/form', locals: { guard_session: guard_session }
    end

    format.json do
      render partial: 'cased/cli/sessions/guard_session', locals: { guard_session: guard_session }
    end
  end
end