mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Update examples to be compatible with Rails 4
This commit is contained in:
@@ -37,7 +37,7 @@ class Devise::ConfirmationsController < DeviseController
|
||||
|
||||
# The path used after confirmation.
|
||||
def after_confirmation_path_for(resource_name, resource)
|
||||
after_sign_in_path_for(resource) if is_navigational_format?
|
||||
after_sign_in_path_for(resource)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ class Devise::PasswordsController < DeviseController
|
||||
|
||||
protected
|
||||
def after_resetting_password_path_for(resource)
|
||||
after_sign_in_path_for(resource) if is_navigational_format?
|
||||
after_sign_in_path_for(resource)
|
||||
end
|
||||
|
||||
# The path used after sending reset password instructions
|
||||
|
||||
@@ -96,7 +96,7 @@ class Devise::RegistrationsController < DeviseController
|
||||
# The path used after sign up. You need to overwrite this method
|
||||
# in your own RegistrationsController.
|
||||
def after_sign_up_path_for(resource)
|
||||
after_sign_in_path_for(resource) if is_navigational_format?
|
||||
after_sign_in_path_for(resource)
|
||||
end
|
||||
|
||||
# The path used after sign up for inactive accounts. You need to overwrite
|
||||
@@ -108,7 +108,7 @@ class Devise::RegistrationsController < DeviseController
|
||||
# The default url to be used after updating a resource. You need to overwrite
|
||||
# this method in your own RegistrationsController.
|
||||
def after_update_path_for(resource)
|
||||
signed_in_root_path(resource) if is_navigational_format?
|
||||
signed_in_root_path(resource)
|
||||
end
|
||||
|
||||
# Authenticates the current scope and gets the current resource from the session.
|
||||
|
||||
@@ -250,7 +250,7 @@ module ActionDispatch::Routing
|
||||
# end
|
||||
#
|
||||
# authenticate :user, lambda {|u| u.role == "admin"} do
|
||||
# root :to => "admin/dashboard#show"
|
||||
# root :to => "admin/dashboard#show", :as => :user_root
|
||||
# end
|
||||
#
|
||||
def authenticate(scope=nil, block=nil)
|
||||
@@ -264,15 +264,15 @@ module ActionDispatch::Routing
|
||||
# a model and allows extra constraints to be done on the instance.
|
||||
#
|
||||
# authenticated :admin do
|
||||
# root :to => 'admin/dashboard#show'
|
||||
# root :to => 'admin/dashboard#show', :as => :admin_root
|
||||
# end
|
||||
#
|
||||
# authenticated do
|
||||
# root :to => 'dashboard#show'
|
||||
# root :to => 'dashboard#show', :as => :authenticated_root
|
||||
# end
|
||||
#
|
||||
# authenticated :user, lambda {|u| u.role == "admin"} do
|
||||
# root :to => "admin/dashboard#show"
|
||||
# root :to => "admin/dashboard#show", :as => :user_root
|
||||
# end
|
||||
#
|
||||
# root :to => 'landing#show'
|
||||
|
||||
Reference in New Issue
Block a user