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
Mount the engine in your routes:
# config/routes.rb mount ZenAdmin::Engine => "/admin"Configure ZenAdmin:
# config/initializers/zen_admin.rb ZenAdmin.configure do |config| config.enable_ui = true config.admin_path = "/admin" endRegister 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 endAccess the admin interface at
/admin
API Endpoints
GET /admin/api/schema/:resource- Get resource schemaGET /admin/api/resources/:resource_name- List resourcesPOST /admin/api/resources/:resource_name- Create resourceGET /admin/api/resources/:resource_name/:id- Show resourcePUT /admin/api/resources/:resource_name/:id- Update resourceDELETE /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.