ransack icon indicating copy to clipboard operation
ransack copied to clipboard

Iterative search refinement

Open indie opened this issue 13 years ago • 2 comments

This isn't so much an issue as a question to whether this is even possible. Nothing I've tried has worked, and my friend who knows Ruby way better than I do doesn't have any working solution either. Here's the question on Stack Overflow: http://stackoverflow.com/questions/16313251/refining-search-with-ransack-gem

Basically, I just need to be able to narrow down the search results, building on the order of the "clicks" every time. Do NOT want to use JS. Thx.

indie avatar May 25 '13 22:05 indie

you can just fill in previously input values into your form

  • prevent the search form from "clearing" and searching each parameter from "root" uniquely?

in your form view

  <%= f.input :codes_cont, input_html: { value: params[:q][:codes_cont] } %>

refer to simple_form documentation https://github.com/plataformatec/simple_form on how to enter your custom value to inputs

rilian avatar May 26 '13 11:05 rilian

Thanks @rilian for your quick answer. The original poster did not reply and it's more than a year ago, so seems OK to close this.

jonatack avatar Aug 29 '14 12:08 jonatack