我正在使用Rails_admin,并且集成了CKEditor,可以上传图像和其他文件。
现在在仪表板上,它向我展示了新模型:
它还在我的模型文件夹中创建了3个ruby文件。
他们都有CRUD动作。我想从其中删除create
和update
动作,只留下show
和delete
,因为它们将通过CKEditor
自身添加。
在rails_admin.rb
这里config.actions do
写的是我加入了这一点:
edit do
except %w(Asset AttachmentFile Picture)
end
当我启动我的应用程序时,thay仍然具有create
和update
操作。
为什么?
我找到了解决方案。在我的rails_admin.rb
文件中,我需要这样写:
new do
except %w(Ckeditor::Asset Ckeditor::AttachmentFile Ckeditor::Picture)
end
edit do
except %w(Ckeditor::Asset Ckeditor::AttachmentFile Ckeditor::Picture)
end
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句