Hello, I have to make some links on the Active Admin administration pages, but I have some problems understanding the hashes to search for specific entries, for example:
column 'Campaigns' do |advertiser| link_to "#{advertiser.campaigns.count} campaigns", admin_campaigns_path('q[advertiser_id_eq]' => advertiser.id) end
I do not understand the meaning:
('q[advertiser_id_eq]')
Why is it inside "q []" and has "_eq?"
or
column 'Entrants' do |campaign| link_to "#{campaign.entrants.count} entrants", admin_entrants_path('q[by_campaign_id]' => campaign.id) end
When I click the links, they do a search for related information in relation on models, but when I change it to normal:
('[campaign_id]' => campaign.id)
it just sends me to the normal index of all the "campaigns" in this latter case. The documentation for activeadmin doesnβt say much about how search queries work.
source share