1
votes

Using Tire.gem to search Im unable to find the correct part of documentation on how to set a "Default search criteria" Who knows how to do this or could point me to relevant documentation sections? thx in advanche!

Would like some criteria to be applied as a foundation, so for example only profiles that match this criteria are returned as search results ( beside the search params )

  • Search all profiles that have profile.completed = true
  • Search all profiles that match the search criteria
1

1 Answers

1
votes

Use a filter on your queries (which I'm sure you're dynamically generating)

so

    Profile.search do
      query { string your_query_string }
      filter :term, :commpleted => true
    end