Ruby on Rails Generating Views

Jason Yost picture Jason Yost · Apr 10, 2011 · Viewed 83.1k times · Source

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 scaffolding command gives me too much and I would rather code my controller by hand. However, writing the index view with a table for the records would not be very efficient.

Answer

Gazler picture Gazler · Apr 10, 2011

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.