Skip to content

Commit

Permalink
WillPaginate default inner_window = 2
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Oct 7, 2015
1 parent 6535411 commit 52d46ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/topics/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>

<div class="panel-footer clearfix">
<%= will_paginate @topics, inner_window: 2 %>
<%= will_paginate @topics %>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<% end %>
</div>
<div class="panel-footer clearfix">
<%= will_paginate @replies, inner_window: 2, params: { anchor: 'replies' } %>
<%= will_paginate @replies, params: { anchor: 'replies' } %>
</div>
</div>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
config.cache_classes = true

config.eager_load = false

Expand Down
1 change: 1 addition & 0 deletions config/initializers/will_paginate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def will_paginate(collection = nil, options = {})
# Taken from original will_paginate code to handle if the helper is not passed a collection object.
collection ||= infer_collection_from_controller
options[:renderer] ||= BootstrapLinkRenderer
options[:inner_window] ||= 2
super.try :html_safe
end

Expand Down

0 comments on commit 52d46ad

Please sign in to comment.