{"id":16956972,"url":"https://github.com/jgraichen/paginate-responder","last_synced_at":"2025-04-05T13:08:05.812Z","repository":{"id":6436853,"uuid":"7675665","full_name":"jgraichen/paginate-responder","owner":"jgraichen","description":"A Rails pagination responder with link header support.","archived":false,"fork":false,"pushed_at":"2025-01-20T09:28:16.000Z","size":95,"stargazers_count":21,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T12:08:42.366Z","etag":null,"topics":["paginate","rails","responder","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgraichen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-01-17T22:27:30.000Z","updated_at":"2024-09-26T20:18:37.000Z","dependencies_parsed_at":"2024-10-26T21:19:38.490Z","dependency_job_id":"6abb36df-9eb4-450d-bc60-8f0b28490f68","html_url":"https://github.com/jgraichen/paginate-responder","commit_stats":{"total_commits":117,"total_committers":14,"mean_commits":8.357142857142858,"dds":0.5470085470085471,"last_synced_commit":"c6a523a523494e4fce3a098ad2f3d1af991ad2c9"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fpaginate-responder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fpaginate-responder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fpaginate-responder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fpaginate-responder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgraichen","download_url":"https://codeload.github.com/jgraichen/paginate-responder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["paginate","rails","responder","ruby"],"created_at":"2024-10-13T22:16:30.532Z","updated_at":"2025-04-05T13:08:05.795Z","avatar_url":"https://github.com/jgraichen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Paginate::Responder\n\n[![Gem](https://img.shields.io/gem/v/paginate-responder?logo=rubygems)](https://rubygems.org/gems/paginate-responder)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/jgraichen/paginate-responder/test.yml?logo=github)](https://github.com/jgraichen/paginate-responder/actions/workflows/test.yml)\n[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/jgraichen/paginate-responder?logo=codeclimate)](https://codeclimate.com/github/jgraichen/paginate-responder)\n\nA Rails pagination responder with link header support.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'paginate-responder'\n```\n\nAnd then execute:\n\n```session\nbundle\n```\n\nOr install it yourself as:\n\n```session\ngem install paginate-responder\n```\n\nYou will also need a pagination gem. `PaginateResponder` comes with adapters for\n\n- [`will_paginate`](https://github.com/mislav/will_paginate),\n- [`kaminari`](https://github.com/amatsuda/kaminari), and\n- [`pagy`](https://github.com/ddnexus/pagy).\n\nIt is recommended to use only one pagination gem at once.\n\n## Usage\n\nAdd `Responders::PaginateResponder` to your responder chain:\n\n```ruby\nclass AppResponder \u003c Responder\n  include Responders::PaginateResponder\nend\n\nclass MyController \u003c ApplicationController\n  self.responder = AppResponder\nend\n```\n\nOr use it with [`plataformatec/responders`](https://github.com/plataformatec/responders):\n\n```ruby\nclass MyController \u003c ApplicationController\n  responders Responders::PaginateResponder\nend\n```\n\n`PaginateResponder` will add the following link headers to\nnon HTML responses:\n\n- `first` First page's URL.\n- `last` Last page's URL.\n- `next` Next page's URL.\n- `prev` Previous page's URL.\n\n`next` and `prev` page links will not be added if current page is `first` or `last` page.\n\nAdditionally, a `X-Total-Pages` header will be added with the total number of pages if available and a `X-Total-Count` header with the total number of items. This allows applications to display a progress bar or similar while fetching pages.\n\n## Override page detections and options\n\nYou can override the page detection by creating a method `page` in your controller that returns the page index as a numeric:\n\n```ruby\nclass ApplicationController\n  def page\n    params[:seite].to_i # seite means page in German\n  end\nend\n```\n\nThe same applies to `per_page` and `max_per_page`:\n\n```ruby\nclass ApplicationController\n  def per_page\n    10\n  end\n\n  def max_per_page\n    25\n  end\nend\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Add tests for your feature.\n4. Add your feature.\n5. Commit your changes (`git commit -am 'Add some feature'`)\n6. Push to the branch (`git push origin my-new-feature`)\n7. Create new Pull Request\n\n## License\n\n[MIT License](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright © 2013-2024, Jan Graichen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgraichen%2Fpaginate-responder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgraichen%2Fpaginate-responder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgraichen%2Fpaginate-responder/lists"}