Update examples to be compatible with Rails 4

This commit is contained in:
José Valim
2013-05-07 08:18:12 -06:00
parent 42fca4dbe5
commit ef2a2280a3
4 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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'