Question

Can the Ransack gem generate a SQL search of multiple columns for the same value?

For instance, something like "users where the first name OR the last name contains 'James'".

Was it helpful?

Solution

Yes, here is an example:

MyModel.search(:firstname_or_lastname_cont => "James").result
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top