Class: Devise::SessionsController
- Inherits:
-
DeviseController
- Object
- DeviseController
- Devise::SessionsController
- Defined in:
- app/controllers/devise/sessions_controller.rb
Instance Method Summary collapse
-
#create {|resource| ... } ⇒ Object
POST /resource/sign_in.
-
#destroy ⇒ Object
DELETE /resource/sign_out.
-
#new {|resource| ... } ⇒ Object
GET /resource/sign_in.
Methods inherited from DeviseController
Instance Method Details
#create {|resource| ... } ⇒ Object
POST /resource/sign_in
18 19 20 21 22 23 24 |
# File 'app/controllers/devise/sessions_controller.rb', line 18 def create self.resource = warden.authenticate!() (:notice, :signed_in) sign_in(resource_name, resource) yield resource if block_given? respond_with resource, location: after_sign_in_path_for(resource) end |
#destroy ⇒ Object
DELETE /resource/sign_out
27 28 29 30 31 32 |
# File 'app/controllers/devise/sessions_controller.rb', line 27 def destroy signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)) :notice, :signed_out if signed_out yield if block_given? respond_to_on_destroy end |
#new {|resource| ... } ⇒ Object
GET /resource/sign_in
10 11 12 13 14 15 |
# File 'app/controllers/devise/sessions_controller.rb', line 10 def new self.resource = resource_class.new(sign_in_params) clean_up_passwords(resource) yield resource if block_given? respond_with(resource, (resource)) end |