- leads = entity.leads.order('updated_at DESC').paginate(page: params[:page], per_page: 20) $('#leads').html('#{ j render(partial: 'leads/lead', collection: leads) }'); $('#leads_pagination').html('#{ j paginate(collection: leads, container: false, params: { action: 'leads' } ) }');