In an ActiveAdmin page, I would like to include a link to a list of related resources. For example, given that a
has_many
Sections and,belongs_to
a Site (in my ActiveRecord models),I would like my Site's show page to include a link to Sections within the site, which would go to the Section index page, with the Site filter preset.
belongs_to
function;What I want is to generate a URL similar to the one ActiveAdmin generates if I first go to the Sections index page and then filter by Site.
The query parameter list generated by ActiveAdmin's filtering feature is pretty crazy; is there a helper method I could use to achieve this goal?
Thanks!
I use this syntax:
link_to "Section", admin_sections_path(q: { site_id_eq: site.id })