アウトプット ゴール
- こちらです。????
何が起きているか?
- No route matches [GET] "/posts" と表示される。
コードについて
- 「index.html.erb」
<h2>My Posts</h2> <ul> <% @posts.each do |post| %> <li><%= post.title %></li> <% end %> </ul>
- 「posts.controller.rb」
class PostsController < ApplicationController def index @posts = Post.all.order(created_at: 'desc') end end
- 「seeds.rb」
5.times do |i| Post.create(title: "title #{i}", body: "#body #{i}" ) end
背景・やっとこと
- ドットインストール
- 「http://192.168.179.5:3000」は表示される
初心者なのですが宜しくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/19 01:43