RailsCasts Pro episodes are now free!

Learn more or hide this

Mauro's Profile

GitHub User: msan

Comments by Mauro

Avatar

what the kaminari corresponding of page_entries_info?
I use it with will_paginate but I didn't find it in kaminari.

Avatar

It seems to me that with Firefox history.pushState doesn't work very well.
With Chrome it's ok but with Firefox it does not.
Here is the code:

$(function () {
  $('.pagination a').live('click', function () {
      $.getScript(this.href);
      history.pushState(null, "", this.href);
      return false;
    });
  $(window).bind("popstate", function() {
      $.getScript(location.href);
  });
});

Chrome renders index.js.erb and it is ok, while firefox renders index.js.erb and after it renders index.html.erb too and it is not ok.
I've tried jquery.ba-bbq.js and it works well with Chrome and with Firefox.

Avatar

I've found that jquery.ba-bbq.js works well than history.pushState

Avatar

It seems that with iceweasel there are problems using history.pushState.
My javascript code is:
$(function () {
  $('.pagination a').live('click', function () {
      $.getScript(this.href);
      history.pushState(null, "", this.href);
      return false;
    });
  $(window).bind("popstate", function() {
      $.getScript(location.href);
  });
});

with chrome it calls, for example, index.js.erb and it is right, while with iceweasel it calls index.js.erb and then also index.html.erb.