Forum: Ruby on Rails Pagination issue because of join

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Neeraj K. (Guest)
on 2006-04-23 09:01
(Received via mailing list)
My current code is like this:

    query = "desc_uf like '%" + session[:search_term] + "%'"
    @event_pages, @events = paginate :events, :per_page => 10
,:conditions   => query ,:order => "start_date DESC"

This query is made against table 'EVENTS' and everything works fine.

Now the query gets complex. I need to make a join to a different table
namely 'STATES'. The 'EVENTS' table has a column named 'VENUE_ID'.
table has a column named 'STATE_ID'. 'STATES' table has the primary

How do I retrieve events only belonging to a particular state using

This topic is locked and can not be replied to.