Posts_controller.rb

Class —

def index

@post = Post.find(1)

end

End

 

Index.html.erb

  <%= @post.content %>

contentはレコード名

変数@postの中(id)contentカラムのデータ表示してください

 

Index.html.erb

  <%= @post.content %>

  <%= @post.created_at %>

変数@postの中(id)contentカラムと作成日カラムのデータを表示してください