私はを通してレールを学んでいます
http://guides.rubyonrails.org/getting_started.html .
コントローラーでセーブデータを実行中にエラーが発生しました。ブログの実行時に表示されるエラーは、「PostsController のアクション 'show' が見つかりませんでした」です。
**
posts_controller.rb の私のコードは
**
class PostsController < ApplicationController
def new
end
def create
@post=Post.new(params[:post].permit(:title,:text))
@post.save
redirect_to @post
end
private
def post_params
params.require(:post).permit(:title,:text)
end
def show
@post=Post.find(params[:id])
end
end
**
show.html.rb の私のコードは
**
<p>
<strong> Title:</strong>
<%= @post.title %>
</p>
<p>
<strong> Text:</strong>
<%= @post.text %>
</p>
**
create_posts.rb のコード
**
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.text :text
t.timestamps
end
end
このエラーが発生する理由を教えてください