From 34b42e3e405f55da26d160e4964f47c0b160cbda Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 7 Feb 2011 20:47:06 +0900 Subject: [PATCH] Ajaxify the links! --- app/views/kaminari/_first_page_link.html.erb | 2 +- app/views/kaminari/_first_page_link.html.haml | 2 +- app/views/kaminari/_last_page_link.html.erb | 2 +- app/views/kaminari/_last_page_link.html.haml | 2 +- app/views/kaminari/_next_link.html.erb | 2 +- app/views/kaminari/_next_link.html.haml | 2 +- app/views/kaminari/_page_link.html.erb | 2 +- app/views/kaminari/_page_link.html.haml | 2 +- app/views/kaminari/_prev_link.html.erb | 2 +- app/views/kaminari/_prev_link.html.haml | 2 +- lib/kaminari/helpers.rb | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/kaminari/_first_page_link.html.erb b/app/views/kaminari/_first_page_link.html.erb index 9b78b67..3ce80dd 100644 --- a/app/views/kaminari/_first_page_link.html.erb +++ b/app/views/kaminari/_first_page_link.html.erb @@ -1,3 +1,3 @@ - <%= link_to page, page_url %> + <%= link_to page, page_url, :remote => remote %> diff --git a/app/views/kaminari/_first_page_link.html.haml b/app/views/kaminari/_first_page_link.html.haml index 5997da4..e03f93f 100644 --- a/app/views/kaminari/_first_page_link.html.haml +++ b/app/views/kaminari/_first_page_link.html.haml @@ -1,2 +1,2 @@ %span.page.first - = link_to page, page_url + = link_to page, page_url, :remote => remote diff --git a/app/views/kaminari/_last_page_link.html.erb b/app/views/kaminari/_last_page_link.html.erb index 68a0198..372ad1f 100644 --- a/app/views/kaminari/_last_page_link.html.erb +++ b/app/views/kaminari/_last_page_link.html.erb @@ -1,3 +1,3 @@ - <%= link_to page, page_url %> + <%= link_to page, page_url, :remote => remote %> diff --git a/app/views/kaminari/_last_page_link.html.haml b/app/views/kaminari/_last_page_link.html.haml index 16be93f..8a69b99 100644 --- a/app/views/kaminari/_last_page_link.html.haml +++ b/app/views/kaminari/_last_page_link.html.haml @@ -1,2 +1,2 @@ %span.page.last - = link_to page, page_url + = link_to page, page_url, :remote => remote diff --git a/app/views/kaminari/_next_link.html.erb b/app/views/kaminari/_next_link.html.erb index 2cf6d06..8e297b5 100644 --- a/app/views/kaminari/_next_link.html.erb +++ b/app/views/kaminari/_next_link.html.erb @@ -1,3 +1,3 @@ - <%= link_to_if (current_page < num_pages), raw('Next »'), next_url, :class => 'next', :rel => 'next' %> + <%= link_to_if (current_page < num_pages), raw('Next »'), next_url, :class => 'next', :rel => 'next', :remote => remote %> diff --git a/app/views/kaminari/_next_link.html.haml b/app/views/kaminari/_next_link.html.haml index fa1a60b..1425194 100644 --- a/app/views/kaminari/_next_link.html.haml +++ b/app/views/kaminari/_next_link.html.haml @@ -1,2 +1,2 @@ %span.next - = link_to_if (current_page < num_pages), raw('Next »'), next_url, :class => 'next', :rel => 'next' + = link_to_if (current_page < num_pages), raw('Next »'), next_url, :class => 'next', :rel => 'next', :remote => remote diff --git a/app/views/kaminari/_page_link.html.erb b/app/views/kaminari/_page_link.html.erb index f0ac5bb..c3d5132 100644 --- a/app/views/kaminari/_page_link.html.erb +++ b/app/views/kaminari/_page_link.html.erb @@ -1,3 +1,3 @@ - <%= link_to page, page_url %> + <%= link_to page, page_url, :remote => remote %> diff --git a/app/views/kaminari/_page_link.html.haml b/app/views/kaminari/_page_link.html.haml index 91979de..50d7536 100644 --- a/app/views/kaminari/_page_link.html.haml +++ b/app/views/kaminari/_page_link.html.haml @@ -1,2 +1,2 @@ %span.page - = link_to page, page_url + = link_to page, page_url, :remote => remote diff --git a/app/views/kaminari/_prev_link.html.erb b/app/views/kaminari/_prev_link.html.erb index dc061d6..d2acc60 100644 --- a/app/views/kaminari/_prev_link.html.erb +++ b/app/views/kaminari/_prev_link.html.erb @@ -1,3 +1,3 @@ - <%= link_to_if (current_page > 1), raw('« Prev'), prev_url, :class => 'prev', :rel => 'prev' %> + <%= link_to_if (current_page > 1), raw('« Prev'), prev_url, :class => 'prev', :rel => 'prev', :remote => remote %> diff --git a/app/views/kaminari/_prev_link.html.haml b/app/views/kaminari/_prev_link.html.haml index 0d76b86..1742ca8 100644 --- a/app/views/kaminari/_prev_link.html.haml +++ b/app/views/kaminari/_prev_link.html.haml @@ -1,2 +1,2 @@ %span.prev - = link_to_if (current_page > 1), raw('« Prev'), prev_url, :class => 'prev', :rel => 'prev' + = link_to_if (current_page > 1), raw('« Prev'), prev_url, :class => 'prev', :rel => 'prev', :remote => remote diff --git a/lib/kaminari/helpers.rb b/lib/kaminari/helpers.rb index 977b52e..4b20fe7 100644 --- a/lib/kaminari/helpers.rb +++ b/lib/kaminari/helpers.rb @@ -129,7 +129,7 @@ module Kaminari end def paginate(scope, options = {}, &block) - PaginationRenderer.new self, options.reverse_merge(:current_page => scope.current_page, :num_pages => scope.num_pages) + PaginationRenderer.new self, options.reverse_merge(:current_page => scope.current_page, :num_pages => scope.num_pages, :remote => false) end end end