{"id":19806506,"url":"https://github.com/monade/solipsist","last_synced_at":"2025-11-11T19:30:25.579Z","repository":{"id":83403945,"uuid":"475041192","full_name":"monade/solipsist","owner":"monade","description":"An approach to write rails controllers in a super compact way.","archived":false,"fork":false,"pushed_at":"2025-01-20T20:55:40.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-20T21:19:44.834Z","etag":null,"topics":["rails","ruby"],"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/monade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2022-03-28T14:33:38.000Z","updated_at":"2025-01-20T20:55:43.000Z","dependencies_parsed_at":"2025-01-20T21:19:20.455Z","dependency_job_id":"52c26bf2-f9d4-493c-a186-a7e4ef52fe7b","html_url":"https://github.com/monade/solipsist","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fsolipsist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fsolipsist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fsolipsist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fsolipsist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monade","download_url":"https://codeload.github.com/monade/solipsist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241150393,"owners_count":19918350,"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":["rails","ruby"],"created_at":"2024-11-12T09:07:44.463Z","updated_at":"2025-11-11T19:30:20.553Z","avatar_url":"https://github.com/monade.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Tests](https://github.com/monade/solipsist/actions/workflows/test.yml/badge.svg)\n\n# Solipsist\n\nA simplified way to write JSON APIs in Rails, taking use of Cancancan and ActiveModel::Serializers.\n\nLess code to write, more fun!\n\n## Installation\n\nAdd the gem to your Gemfile\n\n```ruby\n  gem 'solipsist', github: 'monade/solipsist'\n```\n\n## Philosophy\nWhy keep re-implementing the same things?\n\nA CRUD looks always the same in 90% of cases. So why don't have a default set of actions, and override what is different?\n\n## Usage\n\nAdd Solipsist to your ApplicationController:\n\n```ruby\nclass ApplicationController \u003c ActionController::Base\n  include Solipsist\nend\n```\n\nNow the controller will be super dry!\n\n```ruby\n# Router\napi_resources :people\n\n# Controller\nclass PeopleController \u003c ApplicationController\n  load_and_authorize_resource\n\n  def index\n    default! @people\n  end\n\n  def show\n    default! @person\n  end\n\n  def create\n    default! @person\n  end\n\n  def update\n    default! @person\n  end\n\n  def destroy\n    default! @person\n  end\n\n  private\n\n  def create_params\n    params.permit(:name, :email)\n  end\n\n  def update_params\n    params.permit(:name, :email)\n  end\nend\n```\n\n### Mass actions\n\nYou just have to add the `accept_mass_actions` method to your controller!\n\n```ruby\n# Router\napi_mass_resources :people\n\n# Controller\nclass PeopleController \u003c ApplicationController\n  accept_mass_actions\n  load_and_authorize_resource\n\n  def index\n    default! @people\n  end\n\n  def show\n    default! @person\n  end\n\n  def create\n    default! @person\n  end\n\n  def update\n    default! @person\n  end\n\n  def destroy\n    default! @person\n  end\n\n  private\n\n  def create_params\n    params.permit(:name, :email)\n  end\n\n  def update_params\n    params.permit(:name, :email)\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonade%2Fsolipsist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonade%2Fsolipsist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonade%2Fsolipsist/lists"}