Class: DemoMode::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



26
27
28
29
30
31
32
33
34
# File 'app/controllers/demo_mode/sessions_controller.rb', line 26

def create
  @session = Session.new(create_params)
  @session.
  session[:demo_session] = { 'id' => @session.id, 'last_request_at' => Time.zone.now }
  respond_to do |f|
    f.html { redirect_to @session }
    f.json { render_signinable_json }
  end
end

#newObject



18
19
20
21
22
23
24
# File 'app/controllers/demo_mode/sessions_controller.rb', line 18

def new
  @session = Session.new
  respond_to do |f|
    f.html { render :new }
    f.json { render_personas_json }
  end
end

#showObject



10
11
12
13
14
15
16
# File 'app/controllers/demo_mode/sessions_controller.rb', line 10

def show
  @session = Session.find(params[:id])
  respond_to do |f|
    f.html { begin_demo_if_ready! }
    f.json { render_signinable_json }
  end
end

#updateObject



36
37
38
39
# File 'app/controllers/demo_mode/sessions_controller.rb', line 36

def update
  @session = Session.find(params[:id])
  begin_demo!
end