Skip to content

Commit

Permalink
Update pagination method in CommittersController#index and Committers…
Browse files Browse the repository at this point in the history
…Controller#show
  • Loading branch information
andrew committed Apr 14, 2024
1 parent 74f7925 commit d6d6f62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/committers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def index
scope = scope.order(Arel.sql(sort).desc.nulls_last)
end

@pagy, @committers = pagy(scope)
@pagy, @committers = pagy_countless(scope)
end

def show
Expand All @@ -23,6 +23,6 @@ def show
end
end
raise ActiveRecord::RecordNotFound unless @committer
@pagy, @repositories = pagy(@committer.repositories)
@pagy, @repositories = pagy_countless(@committer.repositories)
end
end
3 changes: 2 additions & 1 deletion app/views/committers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<% end %>
</h1>

<% if @committer.commits_count > 0 %>
<p>
Total Commits: <%= number_with_delimiter @committer.commits_count %><br/>
Repositories: <%= number_with_delimiter @pagy.count %>
</p>
<% end %>

<%= render @repositories %>
<%== pagy_bootstrap_nav(@pagy) if @pagy.pages > 1 %>
Expand Down

0 comments on commit d6d6f62

Please sign in to comment.