Method: Devise::Controllers::Helpers#sign_in_and_redirect

Defined in:
lib/devise/controllers/helpers.rb

#sign_in_and_redirect(resource_or_scope, *args) ⇒ Object

Sign in a user and tries to redirect first to the stored location and then to the url specified by after_sign_in_path_for. It accepts the same parameters as the sign_in method.



235
236
237
238
239
240
241
# File 'lib/devise/controllers/helpers.rb', line 235

def (resource_or_scope, *args)
  options  = args.extract_options!
  scope    = Devise::Mapping.find_scope!(resource_or_scope)
  resource = args.last || resource_or_scope
  (scope, resource, options)
  redirect_to (resource)
end