zorab47 / active_admin-subnav

Enhanced sub-navigation for nested ActiveAdmin resources
MIT License
20 stars 5 forks source link

Add support for pages in subnav with belongs_to #10

Closed edennis closed 1 year ago

edennis commented 6 years ago

First off, thanks for this gem! It's really helped us organize our backend in a much more manageable way.

While customizing our app we found out that the combination of ActiveAdmin::Pages and belongs_to currently doesn't work. This is because HeaderWithSubnav#has_sub_nav? will also try to call #has_nested_resources on an ActiveAdmin::Page object if it belongs to a parent resource.

This PR make that possible.

@zorab47 Incidentally, I found it very difficult to get the tests working and was only able to do so with quite a few changes (see here). Just out of curiosity, how do you normally go about running them?

zorab47 commented 5 years ago

Thanks for the PR and including tests!

I haven't looked into this project in a while and don't recall how to execute the tests. It is probably worthwhile to add continuous integration to the project.