Skip to content

Commit

Permalink
Merge pull request rails#45375 from philippneugebauer/main
Browse files Browse the repository at this point in the history
add repo link for scaffold templates to docs [ci-skip]
  • Loading branch information
jonathanhefner committed Jun 17, 2022
2 parents fbfbd36 + 455d1ce commit 54d866b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion guides/source/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ config.generators do |g|
end
```

If you generate another resource, you can see that we get exactly the same result! This is useful if you want to customize your scaffold templates and/or layout by just creating `edit.html.erb`, `index.html.erb` and so on inside `lib/templates/erb/scaffold`.
Now, if you generate another resource, you will see a similar result!

Another common use of custom templates is overriding the [default scaffold view templates](https://github.com/rails/rails/tree/main/railties/lib/rails/generators/erb/scaffold/templates). You can override any of these by creating the appropriate file (e.g. `index.html.erb`, `show.html.erb`, etc) in `lib/templates/erb/scaffold`.

Scaffold templates in Rails frequently use ERB tags; these tags need to be
escaped so that the generated output is valid ERB code.
Expand Down

0 comments on commit 54d866b

Please sign in to comment.