I need to implement two namespaces in active admin and have different menu design for each.
My namespaces works well and I use view_factory to redifine my nav bar but when I try to set my view for a specific namespace, this view is set for every namespaces.
ActiveAdmin.setup do |config|
config.namespace :dashboard do |dashboard|
dashboard.view_factory.global_navigation = MyNavigation
end
end
class MyNavigation < ActiveAdmin::Component
def build menu, options = {}
# my specific stuff
end
end
I’m using Active Admin 0.5.1 and it should work with multiple namespaces http://reverbhq.com/blog/2012/08/activeadmin-0-5-0-is-released/
If someone knows where I’m wrong 🙂
Just found a hack, needs to create a new ActiveAdmin::ViewFactory.new for each workspace and duplicate common views (you can’t create for all workspaces with config.view_factory…)
It’s not very proper and DRY but it works well