diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..f2de255 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,6 @@ module ApplicationHelper + + # set per_page globally + WillPaginate.per_page = 10 + end diff --git a/app/views/authors/index.js.erb b/app/views/authors/index.js.erb index 41478db..4d33523 100644 --- a/app/views/authors/index.js.erb +++ b/app/views/authors/index.js.erb @@ -1 +1,2 @@ $("#items").html("<%= escape_javascript(render('authors/index')) %>"); +$(".pagination").find("a").attr("data-remote", true); diff --git a/app/views/books/index.js.erb b/app/views/books/index.js.erb index 71a51d0..425b2d3 100644 --- a/app/views/books/index.js.erb +++ b/app/views/books/index.js.erb @@ -1 +1,2 @@ $("#items").html("<%= escape_javascript(render('books/index')) %>"); +$(".pagination").find("a").attr("data-remote", true); diff --git a/app/views/series/index.js.erb b/app/views/series/index.js.erb index 4301451..93006ea 100644 --- a/app/views/series/index.js.erb +++ b/app/views/series/index.js.erb @@ -1 +1,2 @@ $("#items").html("<%= escape_javascript(render('series/index')) %>"); +$(".pagination").find("a").attr("data-remote", true);