{"id":20513665,"url":"https://github.com/theopencms/pagination","last_synced_at":"2026-01-26T18:59:21.075Z","repository":{"id":71919655,"uuid":"84710462","full_name":"TheOpenCMS/pagination","owner":"TheOpenCMS","description":"Pagination helper for Kaminary based Models","archived":false,"fork":false,"pushed_at":"2017-04-02T10:54:42.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T16:47:08.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/TheOpenCMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-03-12T08:13:21.000Z","updated_at":"2017-04-02T10:54:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"684fa171-fd15-4cd8-ba98-20fa3237125c","html_url":"https://github.com/TheOpenCMS/pagination","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheOpenCMS/pagination","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOpenCMS%2Fpagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOpenCMS%2Fpagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOpenCMS%2Fpagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOpenCMS%2Fpagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheOpenCMS","download_url":"https://codeload.github.com/TheOpenCMS/pagination/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOpenCMS%2Fpagination/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28785172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-15T21:12:31.825Z","updated_at":"2026-01-26T18:59:21.058Z","avatar_url":"https://github.com/TheOpenCMS.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"```ruby\nThis gem is a part of TheOpenCMS project. https://github.com/TheOpenCMS\n```\n\n## Pagination\n\nThis simple gem provides the only method `pagination`, which takes `per_page` and `page` parameters from `params` hash and applies these parameters to a Model. In fact this gem just provides a simple helper to improve a typical staff with `per_page` and `page` parameters. Works with `Kaminari`.\n\n```ruby\nclass Product \u003c AR\n  include ::Pagination::Base\nend\n```\n\n```ruby\n@posts = Post.pagination(params)\n```\n\n```ruby\ndiv Items on the page:\n- %w[ 5 10 20 50 100 125 ].each do |num|\n  span= link_to num, url_for(per_page: num)\n```\n\n### Configurations of `page_method_name`\n\n**config/initializers/kaminari.rb**\n\n```ruby\nKaminari.configure do |config|\n  config.page_method_name = :per_page_kaminari\nend\n\nmodule ::Pagination::Base\n  def self.per_method\n    @per = :per_page_kaminari\n  end\nend\n```\n\n## Pagination (RU)\n\nЭтот простой гем всего лишь предоставляет метод `pagination`, который берет параметры `per_page` и  `page` из хеша `params` и применяет их к Модели. По факту гем просто обеспечивает простой хелпер, что бы улучшить типичную работу с переменными `per_page` и `page`. Работает с `Kaminari`.\n\n```ruby\nclass Product \u003c AR\n  include ::Pagination::Base\nend\n```\n\n```ruby\n@posts = Post.pagination(params)\n```\n\n```ruby\ndiv Элементов на странице:\n- %w[ 5 10 20 50 100 125 ].each do |num|\n  span= link_to num, url_for(per_page: num)\n```\n\n### Конфигурация параметра `page_method_name`\n\n**config/initializers/kaminari.rb**\n\n```ruby\nKaminari.configure do |config|\n  config.page_method_name = :per_page_kaminari\nend\n\nmodule ::Pagination::Base\n  def self.per_method\n    @per = :per_page_kaminari\n  end\nend\n```\n\n### MIT License\n\nCopyright (c) 2014-[Current Year] Ilya N. Zykin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheopencms%2Fpagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheopencms%2Fpagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheopencms%2Fpagination/lists"}