Skip to content

Commit 52d46ad

Browse files
committed
WillPaginate default inner_window = 2
1 parent 6535411 commit 52d46ad

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

app/views/topics/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</div>
1919

2020
<div class="panel-footer clearfix">
21-
<%= will_paginate @topics, inner_window: 2 %>
21+
<%= will_paginate @topics %>
2222
</div>
2323

2424
</div>

app/views/topics/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<% end %>
6262
</div>
6363
<div class="panel-footer clearfix">
64-
<%= will_paginate @replies, inner_window: 2, params: { anchor: 'replies' } %>
64+
<%= will_paginate @replies, params: { anchor: 'replies' } %>
6565
</div>
6666
</div>
6767
<% end %>

config/environments/development.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# In the development environment your application's code is reloaded on
77
# every request. This slows down response time but is perfect for development
88
# since you don't have to restart the webserver when you make code changes.
9-
config.cache_classes = false
9+
config.cache_classes = true
1010

1111
config.eager_load = false
1212

config/initializers/will_paginate.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def will_paginate(collection = nil, options = {})
1212
# Taken from original will_paginate code to handle if the helper is not passed a collection object.
1313
collection ||= infer_collection_from_controller
1414
options[:renderer] ||= BootstrapLinkRenderer
15+
options[:inner_window] ||= 2
1516
super.try :html_safe
1617
end
1718

0 commit comments

Comments
 (0)