我想知道如何通过活动的管理GUI获取登录的当前用户?
@H_403_21@解决方法
主页: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’,显然没有实现.
OUTPUT
undefined local variable or method `current_user' for