Skip to content

Commit 2182c6e

Browse files
authored
Merge pull request #141 from h0jeZvgoxFepBQ2C/will_paginate
Add WillPaginate
2 parents ff6b892 + f10e402 commit 2182c6e

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

app/controllers/lit/localization_keys_controller.rb

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def starred
3737
@scope.respond_to?(Kaminari.config.page_method_name)
3838
@scope = @scope.send(Kaminari.config.page_method_name, params[:page])
3939
end
40+
if defined?(WillPaginate) &&
41+
@scope.respond_to?(:paginate)
42+
@scope = @scope.paginate(page: params[:page])
43+
end
4044
get_localization_keys
4145
render action: :index
4246
end
@@ -88,6 +92,8 @@ def get_localization_keys
8892
end
8993
if defined?(Kaminari) and @scope.respond_to?(Kaminari.config.page_method_name)
9094
@localization_keys = @scope.send(Kaminari.config.page_method_name, params[:page])
95+
elsif defined?(WillPaginate) and @scope.respond_to?(:paginate)
96+
@localization_keys = @scope.paginate(page: params[:page])
9197
else
9298
@localization_keys = @scope
9399
end

app/views/lit/localization_keys/index.html.erb

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
<% if defined?(Kaminari) %>
66
<%= paginate @localization_keys, :theme=>"lit" %>
7+
<% elsif defined?(WillPaginate) %>
8+
<%= will_paginate @localization_keys %>
79
<% end %>
810

911
<%= render 'sidebar' %>

app/views/lit/localization_keys/not_translated.html.erb

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
<% if defined?(Kaminari) %>
66
<%= paginate @localization_keys, :theme=>"lit" %>
7+
<% elsif defined?(WillPaginate) %>
8+
<%= will_paginate @localization_keys %>
79
<% end %>
810

911
<%= render 'sidebar' %>

app/views/lit/localization_keys/visited_again.html.erb

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
<% if defined?(Kaminari) %>
66
<%= paginate @localization_keys, :theme=>"lit" %>
7+
<% elsif defined?(WillPaginate) %>
8+
<%= will_paginate @localization_keys %>
79
<% end %>
810

11+
912
<%= render 'sidebar' %>

0 commit comments

Comments
 (0)