ActiveAdmin menu ordering for Admin Comments model

activeadmin, ruby-on-rails-3

Solution

I had a similar problem with ActiveAdmin 1.0beta and wanted to post my solution for posterity.

In initializers/active_admin.rb if you add the "Comments" as a label and disable them in the menu you can move the comments to a dropdown or to the end of the main menu list.

config.show_comments_in_menu = false
# if active_admin >= 1.0, use `config.comments_menu = false`
#....
config.namespace :admin do |admin|
  admin.build_menu do |menu|
    menu.add label: 'Dashboard', priority: 0
    menu.add label: 'Revenue', priority: 3
    menu.add label: 'Costs', priority: 4
    menu.add label: 'Categories', priority: 5
    menu.add label: 'Users & Comments', priority: 6
    menu.add label: 'Comments', parent: 'Users & Comments', url: "/admin/comments"
  end
end

Problem

How can I change the order for the ActiveAdmin Comments model? With my own models I use ``` menu priority: NUMBER ``` in the Admin class. But what about its own Comments class?

Original source