The string #text that was not displayed was displayed, so I investigated it.
Wrong source code index.html.erb ↓
<h1>top page</h1>
<%= @posts.each do |post| %>
<div>
<%= post.memo %>
<%= post.created_at %>
</div>
<% end %>
posts_controller.rb ↓
class PostsController < ApplicationController
def index
@posts = Post.all
end
end
Bring the information in the DB with @posts = Post.all, pass it to html, and embed it in html with <%%>. Looking at the html file, the second line is <% =%>, so it was said that @posts was also displayed. Only post.memo and post.created_at are displayed this time, so the correct answer is ↓
<h1>top page</h1>
<% @posts.each do |post| %>
<div>
<%= post.memo %>
<%= post.created_at %>
</div>
<% end %>
Display by embedding in html with <% =%>. Just embed it in html with <%%>.