Use frame based pagination for the users timeline too

This commit is contained in:
Jorge Manrubia
2025-10-02 15:45:09 +02:00
parent 0d6333f8ba
commit bc90129af2
4 changed files with 22 additions and 6 deletions
+9 -1
View File
@@ -24,7 +24,7 @@ class UsersController < ApplicationController
def show
@filter = Current.user.filters.new(creator_ids: [ @user.id ])
@day_timeline = Current.user.timeline_for(Time.current, filter: @filter)
@day_timeline = Current.user.timeline_for(day_param, filter: @filter)
end
def update
@@ -50,6 +50,14 @@ class UsersController < ApplicationController
head :forbidden unless Current.user.can_change?(@user)
end
def day_param
if params[:day].present?
Time.zone.parse(params[:day])
else
Time.current
end
end
def user_params
params.expect(user: [ :name, :email_address, :password, :avatar ])
end