Administrate

一个 Rails 引擎,帮助您组合一个超级灵活的管理仪表板。(A Rails engine that helps you put together a super-flexible admin dashboard.)

Github stars Tracking Chart

Administrate

用于在 Rails 中创建灵活、强大的管理仪表板的框架。试试这个演示

警告:

Administrate 仍然是 pre-1.0,并且可能偶尔会对 API 进行重大更改。查看发行说明以获取重要更新。

Administrate 是什么?

Administrate 是一个 Rails 应用程序库,用于自动生成管理仪表板。 Administrate 的管理仪表板为非技术用户提供了干净的界面,允许他们为应用程序中的任何模型创建、编辑、搜索和删除记录。

Administrate 解决了与 Rails AdminActiveAdmin 相同的问题,但目的是为站点管理员提供更好的用户体验,并使开发人员更容易定制。

为了实现这些目标,Administrate 遵循一些指导原则:

  • 没有 DSL(特定于域的语言)
  • 支持最简单的用例,并允许用户使用标准工具(如普通Rails控制器和视图)覆盖默认值。
  • 将库拆分为核心组件和插件,因此每个组件都很小,易于维护。

入门

Administrate 支持从4.2到5.0及更高版本的 Rails。我们支持 Ruby 2.4 及更高版本。

将 Administrate 添加到 Gemfile 并重新打包

gem "administrate"

随附的安装程序将为应用程序中的每个模型创建仪表板,并完成路由:

$ rails generate administrate:install

重新启动服务器,然后访问 http://localhost:3000/admin 以查看新的仪表板。

要获得更详细的说明,或者使其只适用于 Rails api 应用程序,请阅读“入门”指南

创建其他仪表板

要创建其他仪表板,请将资源名称传递给仪表板生成器。将创建仪表板和控制器。

$ rails generate administrate:dashboard Foo

文档

要定制仪表板的外观、行为和内容,请参阅 https://administrate-prototype.herokuapp.com 上的指南。这些指南也可以作为 markdown 文件在 git 存储库的 docs 子目录中使用。

存储库结构

此存储库包含 Administrate 的源代码和使用 Administrate 的演示 Rails 应用程序。演示应用程序在 Heroku 上公开托管

Rails 配置文件已经更改,以便在新位置识别应用程序,因此运行服务器或部署到 Heroku 可以正常工作。

使用这种结构,开发一个典型的特性看起来是这样的:

  • spec/ 中添加测试
  • Implement a feature in 在 administrate/ 中实现一项功能
  • Exercise the feature using 使用 demo rails app (spec/example_app/app/) 练习该功能

前端架构

该项目使用:

  • Sass
  • BEM-style CSS selectors, with namespaces
  • Autoprefixer
  • SCSS-Lint, with Hound (configuration)
  • A variety of CSS units:
    • em for typographical-related elements
    • rem for lengths related to components
    • px for borders, text shadows, etc.
    • vw/vh for lengths that should be relational to the viewport

许可

administrate 版权所有©2015-2019 thoughtbot。 它是免费软件,可以根据 LICENSE 文件中指定的条款重新分发。

Overview

Name With Ownerthoughtbot/administrate
Primary LanguageJavaScript
Program languageRuby (Language Count: 6)
PlatformLinux, Mac, Windows
License:MIT License
Release Count30
Last Release Namev1.0.0.beta1 (Posted on 2024-02-05 16:00:22)
First Release Namev0.1.0 (Posted on )
Created At2015-04-10 16:43:02
Pushed At2024-04-29 18:45:30
Last Commit At
Stargazers Count5.8k
Watchers Count88
Fork Count1.1k
Commits Count1.5k
Has Issues Enabled
Issues Count911
Issue Open Count87
Pull Requests Count1187
Pull Requests Open Count28
Pull Requests Close Count444
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

title: Administrate
home: true

CircleCI
Gem Version
Code Climate
Reviewed by Hound

A framework for creating flexible, powerful admin dashboards in Rails.
Try the demo.

Warning:

Administrate is still pre-1.0,
and there may be occasional breaking changes to the API.
Check the release notes for important updates.

administrate

What Is Administrate?

Administrate is a library for Rails apps
that automatically generates admin dashboards.
Administrate's admin dashboards give non-technical users clean interfaces
that allow them to create, edit, search, and delete records
for any model in the application.

Administrate solves the same problem as Rails Admin and ActiveAdmin,
but aims to provide a better user experience for site admins,
and to be easier for developers to customize.

To accomplish these goals, Administrate follows a few guiding principles:

  • No DSLs (domain-specific languages)
  • Support the simplest use cases, and let the user override defaults with
    standard tools such as plain Rails controllers and views.
  • Break up the library into core components and plugins,
    so each component stays small and easy to maintain.

Getting Started

Administrate supports Rails from 4.2, up to 5.0 and beyond. We support Ruby
2.4 and up.

Add Administrate to your Gemfile and re-bundle:

gem "administrate"

The included installer will create dashboards for each model in your
app, complete with routes:

$ rails generate administrate:install

Restart your server, and visit http://localhost:3000/admin
to see your new dashboard in action.

For more detailed instructions or to make it work with Rails API-only applications, please go through the 'Getting Started` guide.

If your apps uses Sprockets 4, you'll need to add Administrate's assets to your manifest.js file. To do this, add these two lines to the file:

//= link administrate/application.css
//= link administrate/application.js

Otherwise, your app will show you this error:

Asset `administrate/application.css` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.

For more information on why this is necessary, see https://www.schneems.com/2017/11/22/self-hosted-config-introducing-the-sprockets-manifestjs

Create Additional Dashboards

In order to create additional dashboards, pass in the resource name to
the dashboard generator. A dashboard and controller will be created.

$ rails generate administrate:dashboard Foo

Documentation

To customize the appearance, behavior, and contents of the dashboard,
see the guides at
https://administrate-prototype.herokuapp.com.
These guides are available as markdown files in the docs subdirectory of the
git repository, too.

Contributing

Please see CONTRIBUTING.md.

administrate was originally written by Grayson Wright and is now maintained by
Nick Charlton. Many improvements and bugfixes were contributed by the open
source
community
.

License

administrate is Copyright © 2015-2019 thoughtbot.
It is free software, and may be redistributed under the terms specified in the
LICENSE file.

About thoughtbot

thoughtbot

administrate is maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software!
See our other projects or
hire us to design, develop, and grow your product.

To the top