Class: DeviseCodeAuthenticatable::SessionsController

Inherits:
Devise::SessionsController
  • Object
show all
Defined in:
app/controllers/devise_code_authenticatable/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#create {|resource| ... } ⇒ Object

Yields:

  • (resource)


3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/devise_code_authenticatable/sessions_controller.rb', line 3

def create
  self.resource = resource_class.(resource_params)
  yield resource if block_given?

  flash.clear 
  if successfully_sent?(resource)
    respond_with resource, location: (resource_name, resource)
  else
    set_flash_message!(:alert, "send_mail_failed")
    respond_with resource, location: (resource)
  end

end