mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 00:31:59 +02:00
Bad pagination that will fail very quickly after launch
This commit is contained in:
parent
466e49c16d
commit
712371101e
2 changed files with 19 additions and 1 deletions
8
app.rb
8
app.rb
|
@ -35,7 +35,13 @@ get '/?' do
|
|||
end
|
||||
|
||||
get '/browse' do
|
||||
@sites = Site.order(:id.desc).filter(~{updated_at: nil}).all
|
||||
@current_page = params[:current_page] || 1
|
||||
@current_page = @current_page.to_i
|
||||
site_dataset = Site.order(:id.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
|
||||
|
||||
@page_count = site_dataset.page_count
|
||||
|
||||
@sites = site_dataset.all
|
||||
slim :browse
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue