Changing flash messages to new Rails defaults :notice/:alert
This commit is contained in:
parent
b4183cbaa2
commit
6d80418fd1
|
@ -5,6 +5,7 @@
|
|||
* Added devise lockable (by github/mhfs)
|
||||
* Warden 0.9.0 compatibility
|
||||
* Mongomapper 0.6.10 compatibility
|
||||
* :success and :failure flash messages are now :notice and :alert
|
||||
|
||||
* bug fix
|
||||
* Accept path prefix not starting with slash
|
||||
|
|
|
@ -7,7 +7,7 @@ class ConfirmationsController < ApplicationController
|
|||
self.resource = resource_class.confirm!(:confirmation_token => params[:confirmation_token])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message :success, :confirmed
|
||||
set_flash_message :notice, :confirmed
|
||||
sign_in_and_redirect(resource_name, resource)
|
||||
else
|
||||
render_with_scope :new
|
||||
|
|
|
@ -16,7 +16,7 @@ class PasswordsController < ApplicationController
|
|||
self.resource = resource_class.reset_password!(params[resource_name])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message :success, :updated
|
||||
set_flash_message :notice, :updated
|
||||
sign_in_and_redirect(resource_name, resource)
|
||||
else
|
||||
render_with_scope :edit
|
||||
|
|
|
@ -7,7 +7,7 @@ class SessionsController < ApplicationController
|
|||
# GET /resource/sign_in
|
||||
def new
|
||||
Devise::FLASH_MESSAGES.each do |message|
|
||||
set_now_flash_message :failure, message if params.try(:[], message) == "true"
|
||||
set_now_flash_message :alert, message if params.try(:[], message) == "true"
|
||||
end
|
||||
super
|
||||
end
|
||||
|
@ -15,10 +15,10 @@ class SessionsController < ApplicationController
|
|||
# POST /resource/sign_in
|
||||
def create
|
||||
if resource = authenticate(resource_name)
|
||||
set_flash_message :success, :signed_in
|
||||
set_flash_message :notice, :signed_in
|
||||
sign_in_and_redirect(resource_name, resource, true)
|
||||
else
|
||||
set_now_flash_message :failure, warden.message || :invalid
|
||||
set_now_flash_message :alert, warden.message || :invalid
|
||||
build_resource
|
||||
render_with_scope :new
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ class SessionsController < ApplicationController
|
|||
|
||||
# GET /resource/sign_out
|
||||
def destroy
|
||||
set_flash_message :success, :signed_out if signed_in?(resource_name)
|
||||
set_flash_message :notice, :signed_out if signed_in?(resource_name)
|
||||
sign_out_and_redirect(resource_name)
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ class UnlocksController < ApplicationController
|
|||
self.resource = resource_class.unlock!(:unlock_token => params[:unlock_token])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message :success, :unlocked
|
||||
set_flash_message :notice, :unlocked
|
||||
sign_in_and_redirect(resource_name, resource)
|
||||
else
|
||||
render_with_scope :new
|
||||
|
|
|
@ -13,7 +13,7 @@ module Devise
|
|||
self.resource = resource_class.send(send_instructions_with, params[resource_name])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message :success, :send_instructions
|
||||
set_flash_message :notice, :send_instructions
|
||||
redirect_to new_session_path(resource_name)
|
||||
else
|
||||
render_with_scope :new
|
||||
|
@ -21,4 +21,4 @@ module Devise
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -109,7 +109,7 @@ module Devise
|
|||
#
|
||||
# def after_sign_in_path_for(resource)
|
||||
# if resource.is_a?(User) && resource.can_publish?
|
||||
# redirect_to publisher_url
|
||||
# publisher_url
|
||||
# else
|
||||
# super
|
||||
# end
|
||||
|
|
Loading…
Reference in New Issue