mislav/will_paginate — Issue #201: Remove the "_=numbers" from url
Author: Shelvak
Created: 2011-11-17 22:58:07+00:00
State: open

Hi man
First I congratulation to you for the fantastic gem =D I use a lot ^^

My issues is, that I do my "paginate" in Ajax, it do perfectly the first time, but when i do the first "next page" The url change... and then the "paginate" refresh the page..

I get the next url
http://localhost:3000/historials?_=1321570021758&p_c=1&p_f=1

p_c and p_f are my 2 params (because i have to paginate 2 differents "historials"

well... i want that you can save me ^^

Here i put my "lines"

In index.js
$("#lentescontacto").html("<%=j render 'contacto' %>");

in my generals.js (it's a Global jQuery file )
$('.pagination a').click(function () {
$.get(this.href, null, null, 'script');
return false;
});

in the view...
<%= will_paginate @contacto, :param_name => :p_c %>
<%= will_paginate @flotante, :param_name => :p_f %>

in controller

@contacto = Historial.where(tipolente: true).paginate(page: params[:p_c], per_page: 5)
@flotante = Historial.where(tipolente: false).paginate(page: params[:p_f], per_page: 20)

I use ruby 3.1 and rails 1.9.2

i think that maybe i can add a "attribute" next param_name to scape the number url...

Good Luck ^^