Hi all, I'm new in Ruby Rails and Spree,
I'm trying to customize the admin search products of Spree, with non success right now. We need to search all products that have the taxons ids that I pass as params but with Ransack I'm able to searh only by one taxon_id per time, if I pass more than one id, ransack takes only the last one, I have to do an INTERSECT of all results by the different ids, SQL for i.e.:
(SELECT spree_products.*
FROM spree_products LEFT OUTER JOIN spree_products_taxons
WHERE spree_products.deleted_at IS NULL
AND spree_products.state = 'Private'
AND spree_products_taxons.taxon_id = 94)
INTERSECT
(SELECT spree_products.*
FROM spree_products LEFT OUTER JOIN spree_products_taxons
WHERE spree_products.deleted_at IS NULL
AND spree_products.state = 'Private'
AND spree_products_taxons.taxon_id = 90)
Is there any chance to do it with the use of Ransack?
I'm able to do it with activerecord not using ransack, but this way I have to change all my views, cause "No Ransack::Search object was provided to search_form_for!".
Thank you in advance!
Lorenc