如何在 Rails Admin 中隐藏添加新选项 [英] How to hide Add new option in Rails Admin

查看:38
本文介绍了如何在 Rails Admin 中隐藏添加新选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在自定义 Rails 管理员:https://github.com/sferik/rails_admin,我需要禁用/隐藏某些模型的添加新"选项.

I am customizing Rails Admin : https://github.com/sferik/rails_admin , i need to disable/hide "Add new" option for some model.

任何帮助都会为我节省很多时间.提前致谢

Any help will save lot time for me. Thanks in advance

推荐答案

我使用以下内容在特定模型上实现此目的.希望这会有所帮助:

I use the following to achieve this on a specific model. Hopefully, this helps:

config.actions do
  new do
    except ['Some Model']
  end
end

这篇关于如何在 Rails Admin 中隐藏添加新选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆