{"id":14955579,"url":"https://github.com/blocknotes/activeadmin_active_resource","last_synced_at":"2025-10-08T18:02:07.327Z","repository":{"id":30025214,"uuid":"123719564","full_name":"blocknotes/activeadmin_active_resource","owner":"blocknotes","description":"Active Admin + Active Resource: to use a REST API in place of a local database as data source","archived":false,"fork":false,"pushed_at":"2024-06-25T13:23:22.000Z","size":113,"stargazers_count":29,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-12T15:51:15.799Z","etag":null,"topics":["activeadmin","activeadmin-plugin","activeresource","rails5","ruby","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/blocknotes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["blocknotes"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2018-03-03T18:24:17.000Z","updated_at":"2024-08-16T05:12:55.000Z","dependencies_parsed_at":"2024-09-24T13:23:42.773Z","dependency_job_id":null,"html_url":"https://github.com/blocknotes/activeadmin_active_resource","commit_stats":{"total_commits":53,"total_committers":6,"mean_commits":8.833333333333334,"dds":"0.41509433962264153","last_synced_commit":"328f7ed17126afec4e15aa26e8f5b7c3ffd4787d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_active_resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_active_resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_active_resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_active_resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocknotes","download_url":"https://codeload.github.com/blocknotes/activeadmin_active_resource/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234724476,"owners_count":18877197,"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":["activeadmin","activeadmin-plugin","activeresource","rails5","ruby","ruby-on-rails"],"created_at":"2024-09-24T13:11:23.971Z","updated_at":"2025-10-01T18:31:37.564Z","avatar_url":"https://github.com/blocknotes.png","language":"Ruby","readme":"# Active Admin + Active Resource\n[![gem version](https://badge.fury.io/rb/activeadmin_active_resource.svg)](https://badge.fury.io/rb/activeadmin_active_resource)\n[![gem downloads](https://badgen.net/rubygems/dt/activeadmin_active_resource)](https://rubygems.org/gems/activeadmin_active_resource)\n[![linters](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/linters.yml)\n[![specs](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs.yml)\n[![specs2](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs2.yml/badge.svg)](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs2.yml)\n\nAn Active Admin plugin to use a REST API data source in place of a local database using [Active Resource](https://github.com/rails/activeresource).\n\n**NOTICE**: currently some Active Admin features don't work as expected:\n\n- Filters are partially supported (see example)\n- Some form fields must be configured explicitly (like the associations)\n- Comments are not supported\n\nPlease :star: if you like it.\n\n## Install\n\n- Add to your project's Gemfile (with Active Admin installed): `gem 'activeadmin_active_resource'`\n- Execute bundle\n- Disable comments in Active Admin config initializer (`config.comments = false`)\n\n## Examples\n\nPlease take a look at the examples folder:\n\n- a Rails6 application with Active Admin and this component, see [here](examples/rails6-admin);\n- a Rails6 API application used as data source, see [here](examples/rails6-api);\n- a Roda API application used as data source, see [here](examples/roda-api).\n\nFor more examples check the [specs](spec).\n\nBasic instructions:\n\n- Post model:\n```rb\nclass Post \u003c ActiveResource::Base\n  self.site = 'http://localhost:3000'  # API url: another Rails project, a REST API, etc.\n\n  self.schema = {  # Fields must be declared explicitly\n    id: :integer,\n    title: :string,\n    description: :text,\n    author_id: :integer,\n    category: :string,\n    dt: :datetime,\n    position: :float,\n    published: :boolean,\n    created_at: :datetime,\n    updated_at: :datetime,\n  }\nend\n```\n\n- Post admin config:\n```rb\nActiveAdmin.register Post do\n  filter :title_cont  # Ransack postfixes required (_eq, _cont, etc.)\n\n  controller do\n    def permitted_params\n      params.permit!  # Permit all just for testing\n    end\n  end\n\n  form do |f|\n    f.inputs do\n      f.input :id, as: :hidden unless f.object.new_record?  # Required\n      f.input :title\n      # ... other fields\n    end\n    f.actions\n  end\nend\n```\n\n- Ransack options [here](https://github.com/activerecord-hackery/ransack#search-matchers)\n- Rails API index example with Ransack and Kaminari:\n```rb\n  after_action :set_pagination, only: [:index]\n\n  def index\n    per_page = params[:per_page].to_i\n    per_page = 15 if per_page \u003c 1\n    @posts = Post.ransack( params[:q] ).result.order( params[:order] ).page( params[:page].to_i ).per( per_page )\n  end\n\n  def set_pagination\n    headers['Pagination-Limit'] = @posts.limit_value.to_s\n    headers['Pagination-Offset'] = @posts.offset_value.to_s\n    headers['Pagination-TotalCount'] = @posts.total_count.to_s\n  end\n```\n\n## Notes\n\nIf you create a new rails project don't use *--skip-active-record*.\n\n## Do you like it? Star it!\n\nIf you use this component just star it. A developer is more motivated to improve a project when there is some interest. My other [Active Admin components](https://github.com/blocknotes?utf8=✓\u0026tab=repositories\u0026q=activeadmin\u0026type=source).\n\nOr consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).\n\n## Contributors\n\n- [Mattia Roccoberton](http://blocknot.es): author\n\n## License\n\nThe gem is available as open-source under the terms of the [MIT](LICENSE.txt).\n","funding_links":["https://github.com/sponsors/blocknotes"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Factiveadmin_active_resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocknotes%2Factiveadmin_active_resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Factiveadmin_active_resource/lists"}