Replies: 1 comment
-
One option is to set the For example: ActiveAdmin.register ParentResource do
menu :false
end
ActiveAdmin.register ChildResource do
belongs_to :parent_resource
navigation_menu :parent_resource
menu(
label: I18n.t(:menu, scope: [[:ChildResource, :action]]),
priority: 2,
if: proc { params[:my_param_requested_for_url_generation].present? },
)
end This is hacky, but it works. By default ActiveAdmin should disable menu if the parent is in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a question (that could get to be a feature request) about menu generation for nested resources (using
belongs_to
).So, what I have is something along those lines:
The menu I get on the
ParentResource
index page:(so far so good)
On the
ChildResource
index though I would like:Though what I get is just:
I tried adding:
But that bugs on the
ChildResource
index page because it tries to generate theChildResource
link without aparams[:parent_resource_id]
and on theChildResource
page it somehow highlights theParentResources
link instead of theChildResource
link.I'm not as intimate with the ActiveAdmin codebase as to know for sure there isn't a way to do what I'd like to do but the documentation does not seem to indicate any way to do this and the researches I've made so far didn't hold fruit. So, is there already a way to achieve this behaviour I havent found or is it something that is not possible so far? And if not, is it a reasonable use case to consider? I'd make a PR if I knew where to look to achieve this 😅
Beta Was this translation helpful? Give feedback.
All reactions