I\'m using the Devise authentication gem in my Rails project, and I want to change the keys it\'s using in flash alerts. (Devise uses :notice and :alert flash keys, but I wa
You need to overwrite DeviseController while keeping around its superclass, in your initializer.
Something like:
class DeviseController < Devise.parent_controller.constantize
def set_flash_message(key, kind, options = {})
if key == 'alert'
key = 'error'
elsif key == 'notice'
key = 'success'
end
message = find_message(kind, options)
flash[key] = message if message.present?
end
end