Remove the "_=numbers" from url #201

Shelvak opened this Issue Nov 17, 2011 · 1 comment


None yet
2 participants

Shelvak commented Nov 17, 2011

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

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 ^^


mislav commented Dec 20, 2011

Sorry for late response.

The "_" parameter is added by jQuery as part of its "cache busting" technique. There should be a way to disable it.

I won't instruct will_paginate to remove this stuff because it wasn't supposed to be present in the first place.

mislav closed this Dec 20, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment