I’m having trouble trying to join on multiple tables. In this example,
I want to do fetch of companies in a specified category and location.
The pagination code is using the will_paginate plugin. Any pointers?
Do I need to resort to a find_by_sql?
@category = Category.find(params[:category_id]) @location = Location.find(params[:location_id]) #Need to join on location id too, how? @companies = @category.companies.paginate :all, :per_page =>
10, :page => params[:page]