Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/application_controller.rb

Defined Under Namespace

Classes: StrongParametersWithEagerAttributesStrategy

Instance Method Summary collapse

Instance Method Details

#stored_location_for(resource) ⇒ Object

Devise override - After login, if there is only one app, redirect to that app's path instead of the root path (apps#index).


10
11
12
13
# File 'app/controllers/application_controller.rb', line 10

def stored_location_for(resource)
  location = super || root_path
  (location == root_path && current_user.apps.count == 1) ? app_path(current_user.apps.first) : location
end