Undefined method 'total_entries' after upgrading Rails 2.2.2 to 2.3.5
- by Trevor
I am upgrading a Rails application from 2.2.2 to 2.3.5. The only remaining error is when I invoke total_entries for creating a jqgrid.
Error:
NoMethodError (undefined method `total_entries' for #<Array:0xbbe9ab0>)
Code snippet:
@route = Route.find(
:all,
:conditions => "id in (#{params[:id]})"
) {
if params[:page].present? then
paginate :page => params[:page], :per_page => params[:rows]
order_by "#{params[:sidx]} #{params[:sord]}"
end
}
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @route }
format.json { render :json => @route }
format.jgrid {
render :json => @route.to_jqgrid_json(
[
:id, :name
],
params[:page],
params[:rows],
@route.total_entries
)
}
end
Any ideas? Thanks!