轨道生成器的前缀
有没有一种方法可以生成带有 admin 文件夹前缀的脚手架。例如,我想要一个 Admin 文件夹和该 admin 文件夹的一些控制器。我想为管理文件夹中的每个控制器做一个脚手架,我想知道是否有类似的东西
script/generate scaffold admin:something somefield:string
Is there a way to generate a scaffold with the admin folder prefix..For example I want one Admin folder and a few controllers for that admin folder. I want to do a scaffold for each controller in the admin folder and i wanted to know if there was something like
script/generate scaffold admin:something somefield:string
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请注意,如果您想让模型不带前缀,则必须手动编辑一些生成的文件才能实现它。这就是为什么我创建了 rails-admin-scaffold gem 并编写了详细的 关于自定义管理区域脚手架的文章。如果这与您无关,也许对其他人有帮助。
Note, that if you'd like to leave model unprefixed, you have to edit some of generated files by hand to implement it. That is why I created rails-admin-scaffold gem and wrote detailed article about custom admin area scaffolding. If that's already not relevant for you, maybe it'll help someone else.