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?
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
Nowadays, you can set the Comments menu priority in config/active_admin.rb
like so:
config.comments_menu = { priority: 1 }
The workaround I've found was using negative numbers for menus that I want to be sure are shown before the Comments model.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With