1qssca
Last Updated: August 23, 2017
·
265
· MaverickRolex

Add items to Active Admin menu

This block of code allows us to add items in the Active Admin dynamic menu without needing to add it as a gem resource, we can also add manually generated paths in the routes.rb file

This code should be put at the end of the file:
Config / initializers / active_admin.rb

config.namespace :admin do |admin|
admin.buildmenu :utilitynavigation do |menu|
menu.add label: "Storage", url: Rails.application.routes.urlhelpers.storagespath
menu.add label: "Transferences", url: Rails.application.routes.urlhelpers.itemtransferspath
admin.add
currentusertomenu menu
admin.add
logoutbuttonto_menu menu
end
end