我想知道如何获取通过活动管理GUI登录的当前用户?如何获取通过活动管理员登录的当前用户?
首页:http://www.activeadmin.info/
在此先感谢
模型
admin_user.rb
class AdminUser < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :id , :admin_permission
# attr_accessible :title, :body
has_one :admin_permission
validates_uniqueness_of :email
def self.current_logged_user
# ?
end
end
UPDATE
当我尝试使用dashboard.rb或任何活动的管理相关文件中的方法'current_user'时,显然它未实现。
输出
undefined local variable or method `current_user' for
谢谢。有用!例如: logger.debug“Current Admin User:#{current_admin_user.email}” – ipegasus 2013-05-09 22:06:10