Patrick,
You may want to set up your search engine to have checkboxes (make sure
the input name is status[], so that it will return an array of values in
ruby) for each theater status (the value of the checkbox being the id of
the related status in the Status table). Then, when a user searches, you
would have the following:
Theater.find(:all, :conditions => ["name LIKE ? AND status_id IN (?)",
"%#{params[:query]}%", params[:status])
This will return all theatres with the searched name and with any of the
statuses checked.
-Jordan
On 11/6/2006, "Patrick Crowley" <[EMAIL PROTECTED]> wrote:
>Ok, thanks guys. That works great for my "show" action.
>
>But it doesn't seem to work when I try to paginate across a list of
>theaters (when showing search results). Do I need to add the status
>table to my query?
>
>Thanks,
>Patrick
>
>
>On Nov 6, 2006, at 2:00 pm, Chris Abad wrote:
>
>> I think you need this:
>>
>> :theater belongs_to :status (rather than has_one :status). Then add
>> status_id to your theaters table.
>>
>> You can then call the status name like this:
>>
>> <%= theater.status.name %>
>
>_______________________________________________
>Sdruby mailing list
>[email protected]
>http://lists.sdruby.com/mailman/listinfo/sdruby
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby