1

我正在自定义 Active Admin 中的菜单。根据此处的文档http://activeadmin.info/docs/2-resource-customization.html#customize_the_menu,我已将此代码放入 active_admin.rb 初始化文件中:

  config.namespace :admin do |admin|
     admin.build_menu do |menu|
       menu.add :label => "Churches", :url => "/", :priority => 0
       menu.add :label => "Liaisons", :url => "/", :priority => 0

       menu.add :label => "Reports" do |reports|
         reports.add :label => "Google", :url => "http://google.com", :html_options => { :target => :blank }
         reports.add :label => "Facebook", :url => "http://facebook.com"
         reports.add :label => "Github", :url => "http://github.com"
       end
     end
  end

不幸的是,这会在应用程序初始化时产生以下错误:in block (2 levels) in <top (required)>': undefined methodbuild_menu' for ActiveAdmin::Namespace:0x007fd241803458> (NoMethodError)

谁能帮我看看我在这里做错了什么?

4

0 回答 0