Project

zen_admin

0.0
No release in over 3 years
ZenAdmin is a Rails engine that provides automatic resource registration, a modern Admin UI based on Bootstrap 5, a built-in RBAC system, and flexible support for custom bulk and member actions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 3.1
~> 1.2
~> 2.3
~> 8.0
~> 4.4
 Project Readme

ZenAdmin

Rails engine for admin interface with Headless API and Bootstrap UI.

Installation

Add this line to your application's Gemfile:

gem "zen_admin"

And then execute:

$ bundle

Or install it yourself as:

$ gem install zen_admin

Usage

  1. Mount the engine in your routes:

    # config/routes.rb
    mount ZenAdmin::Engine => "/admin"
  2. Configure ZenAdmin:

    # config/initializers/zen_admin.rb
    ZenAdmin.configure do |config|
      config.enable_ui = true
      config.admin_path = "/admin"
    end
  3. Register your models:

    # config/initializers/zen_admin.rb
    ZenAdmin.register(User) do |resource|
      resource.list do
        field :email
        field :name
      end
    
      resource.form do
        field :email, type: :string, required: true
        field :name, type: :string
      end
    
      resource.filters do
        filter :email
      end
    end
  4. Access the admin interface at /admin

API Endpoints

  • GET /admin/api/schema/:resource - Get resource schema
  • GET /admin/api/resources/:resource_name - List resources
  • POST /admin/api/resources/:resource_name - Create resource
  • GET /admin/api/resources/:resource_name/:id - Show resource
  • PUT /admin/api/resources/:resource_name/:id - Update resource
  • DELETE /admin/api/resources/:resource_name/:id - Delete resource

UI Pages

  • /admin/ui/:resource_name - List resources
  • /admin/ui/:resource_name/new - New resource form
  • /admin/ui/:resource_name/:id/edit - Edit resource form

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.