ruby-on-rails-3viewscaffold

Ruby on Rails Generating Views


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.


Solution

  • 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.