Skip to content

Commit 0ce44cd

Browse files
committed
Print the record count in the generator guide template override example
1 parent 0f59163 commit 0ce44cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/generators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ To see this in action, let's create a `lib/templates/erb/scaffold/index.html.erb
246246
file with the following contents:
247247

248248
```erb
249-
<%% @<%= plural_table_name %>.count %> <%= human_name.pluralize %>
249+
<%%= @<%= plural_table_name %>.count %> <%= human_name.pluralize %>
250250
```
251251

252252
Note that the template is an ERB template that renders _another_ ERB template.
@@ -265,7 +265,7 @@ $ bin/rails generate scaffold Post title:string
265265
The contents of `app/views/posts/index.html.erb` is:
266266

267267
```erb
268-
<% @posts.count %> Posts
268+
<%= @posts.count %> Posts
269269
```
270270

271271
[scaffold controller template]: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt

0 commit comments

Comments
 (0)