Pagination issue because of join

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs