Support pagination link for Kaminari when no data is returned

This commit is contained in:
Nader Akhnoukh
2016-04-21 20:22:23 -06:00
parent b4e2ac300c
commit 37ca0c1f6c
3 changed files with 25 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ module ActiveModelSerializers
private
def pages_from
return {} if collection.total_pages == FIRST_PAGE
return {} if collection.total_pages <= FIRST_PAGE
{}.tap do |pages|
pages[:self] = collection.current_page