Class: DemoMode::SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- DemoMode::SessionsController
- Defined in:
- app/controllers/demo_mode/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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.save_and_generate_account_later! 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 |
#new ⇒ Object
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 |
#show ⇒ Object
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 |
#update ⇒ Object
36 37 38 39 |
# File 'app/controllers/demo_mode/sessions_controller.rb', line 36 def update @session = Session.find(params[:id]) begin_demo! end |