2

using the ransack gem i've seen that it should be possible to use a form with multiple select.

using the basic html for the select form I use, and then select BOTH options to that I can attempt to search for either value

<select id="q_c_0_v_0_value" name="q[c][0][v][0][value][]" size="1" multiple="multiple">
<option value="SGD">SGD</option>
<option value="USD">USD</option>
</select>

and also tried

<select id="q_c_0_v_0_value" name="q[c][0][v][0][value]" size="1" multiple="multiple">
<option value="SGD">SGD</option>
<option value="USD">USD</option>
</select>

with combinations for all of the predicates "equal any", "contains any" etc,

I get resulting

SELECT "auctions".* FROM "my_table" WHERE (("auctions"."currency" LIKE '%["SGD", "USD"]%'))

and

 SELECT "auctions".* FROM "my_table" WHERE ("auctions"."currency" LIKE '%USD')

Any ideas, the link https://github.com/ernie/ransack/issues/7 says its possible, but I dont seem to get the right results.

user1320651
  • 808
  • 2
  • 15
  • 42

0 Answers0