大佬教程收集整理的这篇文章主要介绍了ruby-on-rails – 如何获取通过活动管理员登录的当前用户?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
主页: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 @R_337_6964@,:body has_one :admin_permission validates_uniqueness_of :email def self.current_logged_user # ? end end
当我尝试在dashboard.rb或任何活动的管理相关文件中使用方法’current_user’,显然没有实现.
OUTPUT
undefined local variable or method `current_user' for
以上是大佬教程为你收集整理的ruby-on-rails – 如何获取通过活动管理员登录的当前用户?全部内容,希望文章能够帮你解决ruby-on-rails – 如何获取通过活动管理员登录的当前用户?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。