0
votes

I'm starting work on a new Ruby on Rails 6 app and I need to find the default scaffold_controller template and also the default view files: _form.html.erb, index.hmtl.erb, edit.html.erb, etc... so that I can customize them by placing them in the /lib/templates folders.

Where are the default templates located so that I can copy them to the /lib/templates folders and modify them?

Thanks !

1
I did read that guide but I didn't find the location for the templates in the guide or in my newly created app. Thanks for providing the link. - user6442102

1 Answers

4
votes

Default view template files are located at: https://github.com/rails/rails/tree/master/railties/lib/rails/generators/erb/scaffold/templates Default controller template file is located at: https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt

In your app, put the customized view templates at: lib/templates/erb/scaffold/ Put the customized controller template at: lib/rails/scaffold_controller/

I hope this helps someone.