Generate a controller with all the RESTful functions

前端 未结 10 1643
遇见更好的自我
遇见更好的自我 2021-01-30 07:58

I am trying to generate a controller with all the RESTful actions stubbed. I had read at Wikibooks - Ruby on Rails that all I needed to do was to call the generator with the co

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 08:53

    I don't know about an automated way of doing it, but if you do:

    script/generate controller your_model_name_in_plural new create update edit destroy index show
    

    All of them will be created for you

    Update for Rails 4

    rails g scaffold_controller Property
    

提交回复
热议问题