简体   繁体   English

rails active admin:如何将表呈现为只读

[英]rails active admin: how to present a table as read only

I let admins do a lot of administration of the web site with the wonderful active admin gem. 我让管理员使用出色的活动admin来对网站进行很多管理。

I have a table called Audit Trail, I want to show the admins this table but obviously it shouldn't be tampered with. 我有一个名为Audit Trail的表,我想向管理员显示此表,但是显然不应该对其进行篡改。

Does active admin support a concept of "read only" tables? 活动管理员是否支持“只读”表的概念?

在您的admin/yourmodel.rb文件中添加此行将仅允许indexshow操作,类似于“只读”:

actions :index, :show

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM