On Sep 24, 4:53 pm, Gearóid O'Ceallaigh <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm trying to perform a simple find on a class but am having trouble
> implementing it.
>
> What I want to perform a dynamic find for each different user. The
> user's location would be variable and I want to display all the
> relevant venues for that user.
>
> My code currently looks something like this:
>
> @location = @current_user.location
>
> @nearby_venues = Venue.find(:all, :conditions => location_id =
> @location, :order => 'name')
>
> This does not work however. I've tried changing the conditions
> statement around a bit but with no luck.
>
> If anybody could tell me how to perform this find, it'd really help me
> out.
>
> Thanks in advance.

You need to correct your :conditions

:conditions => {:location_id => @location.id}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to