生成一个具有所有RESTful函数的控制器 [英] Generate a controller with all the RESTful functions
本文介绍了生成一个具有所有RESTful函数的控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图生成一个控制器与所有的RESTful操作stubbed。我在链接文字中阅读,所有我需要做的是使用调用发电机只是一个控制器名称我会得到的。所以,我运行脚本/生成rspec_controller属性,我有一个空控制器。
I am trying to generate a controller with all the RESTful actions stubbed. I had read at link text that all I needed to do was to use call the generator with just a controller name I would get just that. So, I ran "script/generate rspec_controller Properties" and I got an empty controller.
任何其他建议都将非常感激。
Any other suggestions would be greatly appreciated.
推荐答案
不知道如何做自动化的方式,但如果你这样做:
I don't know about an automated way of doing it, but if you do:
script/generate controller mycontroller new create update edit destroy index show
所有这些都将为您创建
Rails 4的更新
rails g scaffold_controller Property
这篇关于生成一个具有所有RESTful函数的控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文