Searching custom model method with other fields with Ransack

804 Views Asked by At

In my project, Properties belong to Titles and I have a custom model method (ex: "somedate") which extracts a field in one of the associated Title records. I'm using Ransack to search and sort Properties and would like to include a field in my search form for my somedate method.

I'm currently calling <%= property.somedate(id) %> in my search output table via the controller index method (e.g. @search = Property.search(params[:q]) which I'd like to search. I assume that I need a form_tag but I'm unsure how to process the somedate params once it's in the form. How should I do this?

0

There are 0 best solutions below