{"id":22546626,"url":"https://github.com/prx/hal_api-rails","last_synced_at":"2025-03-28T08:45:57.970Z","repository":{"id":45984041,"uuid":"43378536","full_name":"PRX/hal_api-rails","owner":"PRX","description":"rails-dependent gem for adding actions to your hal-based api.","archived":false,"fork":false,"pushed_at":"2024-12-14T17:48:18.000Z","size":169,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-02-02T09:31:13.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/PRX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-09-29T16:07:17.000Z","updated_at":"2024-06-05T14:12:45.000Z","dependencies_parsed_at":"2024-06-05T06:50:44.961Z","dependency_job_id":"3d044e58-bd2c-448e-9984-ef414de23402","html_url":"https://github.com/PRX/hal_api-rails","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fhal_api-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fhal_api-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fhal_api-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fhal_api-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRX","download_url":"https://codeload.github.com/PRX/hal_api-rails/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999320,"owners_count":20707554,"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":[],"created_at":"2024-12-07T15:08:24.149Z","updated_at":"2025-03-28T08:45:57.944Z","avatar_url":"https://github.com/PRX.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HalApi::Rails\n\n[![Build Status](https://travis-ci.org/PRX/hal_api-rails.svg?branch=master)](https://travis-ci.org/PRX/hal_api-rails)\n\nWelcome to hal_api-rails. This is a binding between the responders /\nroar / roar-rails gems and the the PRX HAL api.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'hal_api-rails'\n```\n\nThen add a gem for paging through ActiveRecord result sets:\n```ruby\ngem 'kaminari'\n```\n\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install hal_api-rails\n\n## Usage\n\nThis gem provides a number of additions to the `roar` gem HAL support.\n\nThere are several parts of it that need to be used in your apps:\n\n1) Add to your API controllers:\n\n```ruby\nrequire 'hal_api/rails'\n\nclass Api::BaseController \u003c ApplicationController\n  include HalApi::Controller\n  ...\nend\n```\n\n2) Add to your `ActiveRecord` models used in your API (perhaps in a base model class):\n```ruby\nclass BaseModel \u003c ActiveRecord::Base\n  self.abstract_class = true\n\n  include RepresentedModel\nend\n```\n\n3) Use the base representer, define your own CURIEs:\n```ruby\nclass Api::BaseRepresenter \u003c HalApi::Representer\n  curies(:prx) do\n    [{\n      name: :foo,\n      href: \"http://foo.bar/relation/{rel}\",\n      templated: true\n    }]\n  end\n\n  def index_url_params\n    '{?page,per,zoom}'\n  end\n\n  def show_url_params\n    '{?zoom}'\n  end\nend\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hal_api-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprx%2Fhal_api-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprx%2Fhal_api-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprx%2Fhal_api-rails/lists"}