mislav/will_paginate

The @search variable appears to be empty. Did you forget to pass the collection object for will_paginate?

randall-coding opened this issue · 1 comments

Here is my code in question:

@properties_pg = run_full_query(wheres,joins, selectors, page)

def run_full_query(wheres,joins, selectors, page) Property.select(selectors).joins(create_join_sql(joins)).joins(create_wheres_sql(wheres,joins.present?)).paginate(page:page) end

Yet when I add <%= will_paginate @properties_pg %> I get the error shown below

The @search variable appears to be empty. Did you forget to pass the collection object for will_paginate?

I don't do anything to modify the variable @properties_pg. Any ideas where this error is coming from? Does paginate just not like joins?

Never mind, stupid error on my part. My @properties_pg was only visible in a service object not the controller.