add views to default app controller? or generate new home controller?

So when one make a new Rails application, is it ok to add new views in the application controller (to make about/privacy or contact pages)? Or is it good and standard practise to generate a new and seperate controller as shown in the getting started tutorial?

I'm starting a new app in Rails 6 and I'm going to document the whole process of creating a complete minimal viable app.

1 thought on “add views to default app controller? or generate new home controller?”

  1. Generally you’ll want to make descendant controller classes, and leave ApplicationController without any public methods (actions) of its own.

    As an aside, `rails g controller home` (or `static_pages`) will make a new controller file and class for you. If you list actions after it’ll add them in as methods too, but I’d recommend checking the docs for `rails generate` for more details.

    Source: am rails dev of several years now.

    Reply

Leave a Comment