Skip to content

Commit

Permalink
Reset page on per change
Browse files Browse the repository at this point in the history
  • Loading branch information
gryphon committed Feb 14, 2025
1 parent 434545e commit 12e4813
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/concerns/custom_table_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def custom_table collection, variant = nil, default_sorts: "created_at desc", de
collection = @q.result(distinct: true)
# collection = collection.page(params[:page]).per(per_page) if format_web && paginate

params[:page] = 1 if !params[:per].nil?

if !current_user.nil?
current_user.save_custom_table_settings(collection.model, variant, per_page: params[:per]) if !params[:per].nil? && params[:do_not_save_settings].nil?
if !params[:q].nil? && !params[:q][:s].nil? && !@q.nil? && !@q.sorts[0].nil? && !@q.sorts[0].name.nil? && params[:do_not_save_settings].nil?
Expand Down

0 comments on commit 12e4813

Please sign in to comment.