Ruby on rails Activeadmin在筛选之前使用时出现运行时错误
我想为管理员添加一个全局前过滤器。在我的Ruby on rails Activeadmin在筛选之前使用时出现运行时错误,ruby-on-rails,activeadmin,Ruby On Rails,Activeadmin,我想为管理员添加一个全局前过滤器。在我的config/initializers/active_admin.rb中,我有 config.before_filter :do_something_awesome 以及在应用程序\u controller.rb中 def do_something_awesome # raise end 当我尝试启动我的服务器时,它会因以下错误而停止 Exiting C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/g
config/initializers/active_admin.rb
中,我有
config.before_filter :do_something_awesome
以及在应用程序\u controller.rb中
def do_something_awesome
# raise
end
当我尝试启动我的服务器时,它会因以下错误而停止
Exiting
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:492:in `load_missing_constant': Circular dependency detected while autoloading constant Student (RuntimeError)
我也可以在动作前使用,而不是在动作前使用,因为Rails 4.2不推荐在动作前使用,是的,你可以在动作前使用。是的,你可以在动作前使用。检查此链接以更好地理解错误,检查此链接以更好地理解错误,