Patrick,

Just to make sure, you've named your "status" table "statuses"
correct? If not, your association in your Theatre should be:

class Theatre  < ActiveRecord::Base
..
  belongs_to :status, :class_name => "Status"
..
end

-Jordan

On 11/6/2006, "Patrick Crowley" <[EMAIL PROTECTED]> wrote:

>Let me clarify.
>
>While Nathan's solution would work great for searching on a
>particular status (all "closed" theaters, for instance), I just need
>to get back the status for _each_ theater in a basic query search.
>
>> /search?query=apollo
>
>When I use <%= theater.status.name %> in my for loop, I get a nil
>object error. So, I'm guessing I need to find a way to preload the
>status name for each theater object in my result set.
>
>-- Patrick
>
>
>On Nov 6, 2006, at 2:28 PM, Chris Abad wrote:
>
>> Ah, I see what you mean now. Yea, this sounds like a step in the
>> right direction.
>>
>> On Nov 6, 2006, at 2:27 PM, Nathan Colgate Clark wrote:
>>
>>> Probably, Yeah.  Try passing it with your pagination_links
>>> method.  If i remember from Friday:
>>>
>>> pagination_links(@results, {:query => params[:query], :status =>
>>> params[:status]})
>>>
>>> might get you some links like:
>>>
>>> /search?query=apollo&status=1
>>>
>>> where 1 is "open" or whatever.
>>>
>>> Good luck.
>_______________________________________________
>Sdruby mailing list
>[email protected]
>http://lists.sdruby.com/mailman/listinfo/sdruby
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to