Wouldn't the following work?
Person.search params[:search], :conditions => {...@filter_on.to_sym =>
'Adams'}
Or are you wanting to do something a little more complex?
Cheers
--
Pat
On 29/06/2010, at 6:02 AM, Walksalong wrote:
> A newbie to TS here and I was wondering is there a way to write out
> dynamic conditions based on multiple filters in the form?
>
> I'd like to do something like:
>
> @filter_on = params[:filter_on] #ex. email
>
> @people = Person.search params[:search], :conditions => {:@filter_on
> => "Adams"}
>
>
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/thinking-sphinx?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.