Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Rails:如何添加管理员批准功能,其中用户上传的图像必须在其个人资料中显示之前获得批准?
如何在用户头像上添加一列,上面写着admin_approved或类似的东西?由于您使用的是 ActiveAdmin,因此它应该选择该列(除非您另有指定)。然后在显示图像之前添加一个检查:
admin_approved
<%= user_images.each do |image| %> <% if image.admin_approved %> <%= image_tag image.url %> <% end %> <% end %>