Reputation: 21
So, I have been working with Ruby on Rails and ActiveAdmin for a while now, but it seems that I might be missing something basic...
I want to have my own Utility Navigation in my application, sounds easy enough, there is some documentation pointing to this on the main ActiveAdmin documentation page.
Makes sense, and should probably simple enough...
ActiveAdmin.setup do |config|
config.namespace :admin do |admin|
admin.build_menu :utility_navigation do |menu|
menu.add label: "ActiveAdmin.info", url: "http://www.activeadmin.info", html_options: { target: :blank }
admin.add_logout_button_to_menu menu # can also pass priority & html_options for link_to to use
end
end
end
BUT, I have...
config.default_namespace = false
which sort of turns off the
config.namespace :admin do |admin|
bit of code.
My assumption was to just go back to using the standard non-namespace version for configuration, much like so many other parts of the configuration system and just use.
ActiveAdmin.setup do |config|
config.build_menu :utility_navigation do |menu|
menu.add label: "ActiveAdmin.info", url: "http://www.activeadmin.info", html_options: { target: :blank }
config.add_logout_button_to_menu menu # can also pass priority & html_options for link_to to use
end
end
BUT, of course I get undefined method 'build_menu'
.
So, I have to assume that I am missing something simple, and at the moment I am not sure what that simple thing is.
If anyone out there has any suggestions, please let me know.
Mark,
Upvotes: 2
Views: 1001
Reputation: 61
In this case you should be able to use the :root namespace.
ActiveAdmin.setup do |config|
config.namespace :root do |admin|
admin.build_menu :utility_navigation do |menu|
menu.add label: "ActiveAdmin.info", url: "http://www.activeadmin.info", html_options: { target: :blank }
admin.add_logout_button_to_menu menu # can also pass priority & html_options for link_to to use
end
end
end
Upvotes: 4