主动管理定制
我有一个带有字段状态的 Event
模型,它是字符串,因此它显示为 text_field
。但我有一个可能状态的列表,我想将其显示为选择
框。此外,当我选择活动的取消
状态时,它应该询问我取消原因。我无法为此找到好的教程。
I have an Event
model with field status, which is string so it appears as a text_field
. But I have a list of possible statuses and I want to display it as a select
box. Also, when I select cancel
status for a event it should ask me for the cancellation reason. I am not able to find good tutorial for this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是几乎所有自定义的示例:)
编辑
有一些可用的主题
https://github.com/vigetlabs/active_material
https://github.com/activeadmin-plugins/active_admin_theme
https://github.com/paladini/activeadmin-themes
Following is the example almost all customizations :)
EDIT
There are a few themes available
https://github.com/vigetlabs/active_material
https://github.com/activeadmin-plugins/active_admin_theme
https://github.com/paladini/activeadmin-themes
ActiveAdmin 使用 Formtastic 生成表单,因此 Formtastic 的文档应该可以回答您的问题。
您可以使用以下代码获得选择而不是文本字段:
选择“取消”时触发事件应该使用 javascript 解决。
ActiveAdmin uses Formtastic for form generation, so Formtastic's documentation should answer your questions.
You can get a select instead of a textfield with the following code:
Triggering an event when selecting "cancelled" should be solved with javascript.