{"id":13515792,"url":"https://github.com/excid3/madmin","last_synced_at":"2025-04-11T01:33:49.399Z","repository":{"id":42085887,"uuid":"294590082","full_name":"excid3/madmin","owner":"excid3","description":"A robust Admin Interface for Ruby on Rails apps","archived":false,"fork":false,"pushed_at":"2024-10-21T20:48:35.000Z","size":1940,"stargazers_count":556,"open_issues_count":9,"forks_count":63,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-10-29T14:15:50.449Z","etag":null,"topics":["admin","admin-dashboard","hacktoberfest","rails","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://github.com/excid3/madmin","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/excid3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"MIT-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},"funding":{"github":["excid3"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-11T04:02:20.000Z","updated_at":"2024-10-28T09:27:16.000Z","dependencies_parsed_at":"2024-01-13T19:25:39.253Z","dependency_job_id":"c87baa68-0733-4bf6-bcf9-9ca0a17adf0c","html_url":"https://github.com/excid3/madmin","commit_stats":{"total_commits":346,"total_committers":28,"mean_commits":"12.357142857142858","dds":"0.28612716763005785","last_synced_commit":"f600dd8e39d8dd66ea652a2ecf0cecf68f2c2557"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excid3%2Fmadmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excid3%2Fmadmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excid3%2Fmadmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excid3%2Fmadmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/excid3","download_url":"https://codeload.github.com/excid3/madmin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248325452,"owners_count":21084929,"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":["admin","admin-dashboard","hacktoberfest","rails","ruby","ruby-on-rails"],"created_at":"2024-08-01T05:01:16.031Z","updated_at":"2025-04-11T01:33:49.360Z","avatar_url":"https://github.com/excid3.png","language":"Ruby","funding_links":["https://github.com/sponsors/excid3"],"categories":["Ruby","Admin Interface"],"sub_categories":[],"readme":"# Madmin\n\n### 🛠 A robust Admin Interface for Ruby on Rails apps\n\n[![Build Status](https://github.com/excid3/madmin/workflows/Tests/badge.svg)](https://github.com/excid3/madmin/actions) [![Gem Version](https://badge.fury.io/rb/madmin.svg)](https://badge.fury.io/rb/madmin)\n\nWhy another Ruby on Rails admin? We wanted an admin that was:\n\n- Familiar and customizable like Rails scaffolds (less DSL)\n- Supports all the Rails features out of the box (ActionText, ActionMailbox, has_secure_password, etc)\n- Stimulus / Turbolinks / Hotwire ready\n- Works with Import maps and Sprockets\n\n![Madmin Screenshot](docs/images/screenshot.png)\n\n## Installation\n\nAdd `madmin` to your application's Gemfile:\n\n```bash\nbundle add madmin\n```\n\nThen run the madmin generator:\n\n```bash\nrails g madmin:install\n```\n\nThis will install Madmin and generate resources for each of the models it finds.\n\n## Resources\n\nMadmin uses `Resource` classes to add models to the admin area.\n\n### Generate a Resource\n\nTo generate a resource for a model, you can run:\n\n```bash\nrails g madmin:resource ActionText::RichText\n```\n\n### Avoid N+1 queries\n\nIn case of N+1 queries, you can preload the association by overriding the `scoped_resource` method in the controller:\n\n```ruby\nmodule Madmin\n  class PostsController \u003c Madmin::ResourceController\n    private\n\n    def scoped_resources\n      super.includes(:user)\n    end\n  end\nend\n\n```\n\n## Configuring Views\n\nThe views packaged within the gem are a great starting point, but inevitably people will need to be able to customize those views.\n\nYou can use the included generator to create the appropriate view files, which can then be customized.\n\nFor example, running the following will copy over all of the views into your application that will be used for every resource:\n\n```bash\nrails generate madmin:views\n```\n\nThe view files that are copied over in this case includes all of the standard Rails action views (index, new, edit, show, and \\_form), as well as:\n\n- `application.html.erb` (layout file)\n- `_javascript.html.erb` (default JavaScript setup)\n- `_navigation.html.erb` (renders the navigation/sidebar menu)\n\nAs with the other views, you can specifically run the views generator for only the navigation or application layout views:\n\n```bash\nrails g madmin:views:navigation\n # -\u003e app/views/madmin/_navigation.html.erb\n\nrails g madmin:views:layout  # Note the layout generator includes the layout, javascript, and navigation files.\n # -\u003e app/views/madmin/application.html.erb\n # -\u003e app/views/madmin/_javascript.html.erb\n # -\u003e app/views/madmin/_navigation.html.erb\n```\n\nIf you only need to customize specific views, you can restrict which views are copied by the generator:\n\n```bash\nrails g madmin:views:index\n # -\u003e app/views/madmin/application/index.html.erb\n```\n\nYou might want to make some of your model's attributes visible in some views but invisible in others.\nThe `attribute` method in model_resource.rb gives you that flexibility.\n\n```bash\n # -\u003e app/madmin/resources/book_resource.rb\n```\n\n```ruby\nclass UserResource \u003c Madmin::Resource\n  attribute :id, form: false\n  attribute :tile\n  attribute :subtitle, index: false\n  attribute :author\n  attribute :genre\n  attribute :pages, show: false\nend\n```\n\nYou can also scope the copied view(s) to a specific Resource/Model:\n\n```bash\nrails generate madmin:views:index Book\n # -\u003e app/views/madmin/books/index.html.erb\n```\n\n## Custom Fields\n\nYou can generate a custom field with:\n\n```bash\nrails g madmin:field Custom\n```\n\nThis will create a `CustomField` class in `app/madmin/fields/custom_field.rb`\nAnd the related views:\n\n```bash\n# -\u003e app/views/madmin/fields/custom_field/_form.html.erb\n# -\u003e app/views/madmin/fields/custom_field/_index.html.erb\n# -\u003e app/views/madmin/fields/custom_field/_show.html.erb\n```\n\nYou can then use this field on our resource:\n\n```ruby\nclass PostResource \u003c Madmin::Resource\n  attribute :title, field: CustomField\nend\n```\n\n## Authentication\n\nYou can use a couple of strategies to authenticate users who are trying to\naccess your madmin panel: [Authentication Docs](docs/authentication.md)\n\n## Assets\nYou can customize the JavaScript and CSS assets used by Madmin for your application. To learn how\nsee the [Assets Doc](docs/assets.md)\n\n## 🙏 Contributing\n\nThis project uses Standard for formatting Ruby code. Please make sure to run standardrb before submitting pull requests.\n\n## 📝 License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcid3%2Fmadmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexcid3%2Fmadmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcid3%2Fmadmin/lists"}