Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SessionsController
- Defined in:
- app/controllers/sessions_controller.rb
Overview
セッションを扱うコントローラ
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 |
# File 'app/controllers/sessions_controller.rb', line 6 def create return head :bad_request if params[:username].blank? session[:username] = params[:username].to_s render text: session[:username] end |
#destroy ⇒ Object
14 15 16 17 18 |
# File 'app/controllers/sessions_controller.rb', line 14 def destroy session[:username] = nil render nothing: true end |