module Devise::Controllers::Helpers
def after_sign_in_path_for(resource_or_scope)
end
end
super
else
publisher_url
if resource.is_a?(User) && resource.can_publish?
def after_sign_in_path_for(resource)
is not enough, you can customize it, for example:
If none of these are defined, root_path is used. However, if this default
end
users.root # creates user_root_path
map.resources :users do |users|
map.user_root '/users', :controller => 'users' # creates user_root_path
the following way:
uses the root path. For a user scope, you can define the default url in
By default, it first tries to find a resource_root_path, otherwise it
provide a custom hook for a custom resource.
controllers and you can overwrite it in your ApplicationController to
The default url to be used after signing in. This is used by all Devise
def after_sign_in_path_for(resource_or_scope) scope = Devise::Mapping.find_scope!(resource_or_scope) home_path = :"#{scope}_root_path" respond_to?(home_path, true) ? send(home_path) : root_path end