Module: Users::Lib::Devise::Controllers::InternalHelpers

Defined in:
lib/users/lib/devise/controllers/internal_helpers.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/users/lib/devise/controllers/internal_helpers.rb', line 7

def self.included(base)
  
  base.class_eval do
    
    def set_flash_message(key, kind, now=false)
      type = [:invalid, :alert, :unauthenticated].include?(kind) ? :error : kind
      type = [:error].include?(type) ? type : :notice
      
      flash[type] = I18n.t(:"#{kind}", 
        :scope => [:devise, controller_name.to_sym], :default => kind)
    end
    
    def (resource)
      default_admin_path
    end
    
  end
end