{"id":21428701,"url":"https://github.com/ergoserv/auxiliary_rails_resourceable","last_synced_at":"2025-10-13T17:06:20.815Z","repository":{"id":57042916,"uuid":"526881392","full_name":"ergoserv/auxiliary_rails_resourceable","owner":"ergoserv","description":"AuxiliaryRails::Resourceable module speeds up development by loading your controllers with RESTful (CRUD) actions.","archived":false,"fork":false,"pushed_at":"2024-08-17T09:49:14.000Z","size":57,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-09T04:56:39.989Z","etag":null,"topics":["ruby","ruby-gem","ruby-on-rails"],"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/ergoserv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-08-20T09:28:43.000Z","updated_at":"2025-01-29T12:37:09.000Z","dependencies_parsed_at":"2024-03-18T21:36:52.024Z","dependency_job_id":"54206d31-1c82-49e9-aadb-4cb7280ddd3b","html_url":"https://github.com/ergoserv/auxiliary_rails_resourceable","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.05714285714285716,"last_synced_commit":"9fee5d7af2dde96cf3491eea08a0c80f6d58f490"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ergoserv/auxiliary_rails_resourceable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergoserv%2Fauxiliary_rails_resourceable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergoserv%2Fauxiliary_rails_resourceable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergoserv%2Fauxiliary_rails_resourceable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergoserv%2Fauxiliary_rails_resourceable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ergoserv","download_url":"https://codeload.github.com/ergoserv/auxiliary_rails_resourceable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergoserv%2Fauxiliary_rails_resourceable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013974,"owners_count":26085429,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ruby","ruby-gem","ruby-on-rails"],"created_at":"2024-11-22T22:14:30.052Z","updated_at":"2025-10-13T17:06:20.775Z","avatar_url":"https://github.com/ergoserv.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AuxiliaryRails::Resourceable\n\n[![Gem](https://img.shields.io/gem/v/auxiliary_rails_resourceable.svg)](https://rubygems.org/gems/auxiliary_rails_resourceable)\n\n`Resourceable` module speeds up development by loading your controllers with RESTful (CRUD) actions.\n\nIt is powered with search ([ransack](https://github.com/activerecord-hackery/ransack)), pagination ([pagy](https://github.com/ddnexus/pagy)) and policies ([pundit](https://github.com/varvet/pundit)).\nAll these make your controllers and views much cleaner, so you can just focus on what is important.\n\n`Resourceable` aims to be as simple and flexible as possible and suggests customization using regular method overwriting instead of tricky configs or DSLs.\nOf course, it may not cover all possible cases, but if you need something really custom - just write custom code.\n\n\n## Installation\n\nAdd one of these lines to your application's `Gemfile`:\n\n```ruby\n# version released to RubyGems (recommended)\ngem 'auxiliary_rails_resourceable'\n\n# or latest development version from a specific branch of the GitHub repository\ngem 'auxiliary_rails_resourceable',\n  git: 'https://github.com/ergoserv/auxiliary_rails_resourceable',\n  branch: 'develop'\n# or from a local path (for development and testing purposes)\ngem 'auxiliary_rails_resourceable',\n  path: '../auxiliary_rails_resourceable'\n```\n\nCopy `resources.en.yml` to `config/locales/resources.en.yml`.\n\nCreate shared views in `app/views/resources/` (or `app/views/resourceable/` if your need to share views for modules).\nRecommended structure for views:\n```\nindex.html.erb\nnew.html.erb\nshow.html.erb\nedit.html.erb\n_form.html.erb\n_list.html.erb\n_search_form.html.erb\n```\n\n## Usage\n\nJust define `ResourcesController` and inherit controllers from it for fulfilling them with the all the basic CRUD actions.\n\n```ruby\n# app/controllers/resources_controller.rb\n# @abstract\nclass ResourcesController \u003c ApplicationController\n  include AuxiliaryRails::Concerns::Resourceable\nend\n\n# app/controllers/products_controller.rb\nclass ProductsController \u003c ResourcesController\nend\n```\n\n### Customization\n\n`Resourceable` is a very simple and clear module, just read its code and overwrite\nwhat you need in `ResourcesController` or any of its subclasses, e.g.:\n\n```ruby\n# app/controllers/products_controller.rb\nclass ProductsController \u003c ResourcesController\n  # Load additional data for views\n  def index\n    super\n    self.collection = collection.includes([:category])\n  end\n\n  protected\n\n  # Add any additional scopes to the collection scope\n  def collection_scope\n    policy_scope(Product).active.in_stock\n  end\n\n  # Overwrite Pagy configs using Pagy's methods\n  # https://github.com/ddnexus/pagy/blob/master/lib/pagy/backend.rb#L19\n  def pagy_get_vars(collection, vars)\n    vars[:items] = 250\n    super\n  end\nend\n```\n\n## References\n\nThis gem is heavily inspired by [inherited_resources](https://github.com/activeadmin/inherited_resources) and [activeadmin](https://github.com/activeadmin/activeadmin).\nIt even follows the naming for helpers of `inherited_resources`, but much lighter (~250 lines of code only), with an approach of \"just overwrite what you need\" instead of complex configuration options. And, in simple cases, can be used as a drop-in replacement with no or just a few code changes.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` 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 the created tag, 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/ergoserv/auxiliary_rails_resourceable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ergoserv/auxiliary_rails_resourceable/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the AuxiliaryRailsResourceable project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ergoserv/auxiliary_rails_resourceable/blob/master/CODE_OF_CONDUCT.md).\n\n-------------------------------------------------------------------------------\n\n[![alt text](https://raw.githubusercontent.com/ergoserv/auxiliary_rails/master/assets/ErgoServ_horizontalColor@sign+text+bg.png \"ErgoServ - Web and Mobile Development Company\")](https://www.ergoserv.com)\n\nThis gem was created and is maintained by [ErgoServ](https://www.ergoserv.com).\n\nIf you like what you see and would like to hire us or join us, [get in touch](https://www.ergoserv.com)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergoserv%2Fauxiliary_rails_resourceable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fergoserv%2Fauxiliary_rails_resourceable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergoserv%2Fauxiliary_rails_resourceable/lists"}