Ruby on Rails Generating Views

前端 未结 4 986
名媛妹妹
名媛妹妹 2021-01-31 13:52

Is there a way to generate the views separately using the rails generate command? I would also be willing to install a gem to accomplish that task f one exists. Basically the sc

4条回答
  •  北海茫月
    2021-01-31 14:19

    You can generate the controller and the view using the controller generator.

    rails g controller controllername new create
    

    This will create actions new and create with their corresponding views.

    You still need to set up your routes manually with this.

提交回复
热议问题