针对 Ruby on Rails 应用程序的强大管理界面
为什么还要另一个 Ruby on Rails 管理员? 我们希望有一个管理员,其特点是:
在应用程序的 Gemfile 中添加 madmin:
bundle add madmin然后运行 madmin 生成程序:
rails g madmin:install这将安装 Madmin 并为它找到的每个模型生成资源。
Madmin 使用 Resource 类来将模型添加到管理区域。
要为模型生成资源,可以运行:
You might want to make some of your model's attributes visible in some views but invisible in others.
The `attribute` method in model_resource.rb gives you that flexibility.
bash
ruby class BookResource app/views/madmin/books/index.html.erb
### 设定字段类型
您可以将字段类型设置为第二个参数。字段类型可能具有用于呈现字段 UI 的其他选项。
对于 e暂无开放 Issues,或尚未同步最近议题。