title: Error :The action 'show' could not be found for PostsController"
body: <p>i have been learning rails through </p>
  
  <p><a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">http://guides.rubyonrails.org/getting_started.html</a>.</p>
  
  <p>I came across a error while performing save data in controller. The error that comes up when running the blog is :"The action 'show' could not be found for PostsController"</p>
  
  <p>**</p>
  
  <blockquote>
    <p><strong>My code for posts_controller.rb  is</strong></p>
  </blockquote>
  
  <p>**</p>
  
  <pre><code>class PostsController &lt; 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
  </code></pre>
  
  <p>**</p>
  
  <p>My code for show.html.rb is</p>
  
  <p>** </p>
  
  <pre><code>&lt;p&gt;
  &lt;strong&gt; Title:&lt;/strong&gt;
  &lt;%= @post.title %&gt;
  &lt;/p&gt;
  &lt;p&gt;
  &lt;strong&gt; Text:&lt;/strong&gt;
  &lt;%= @post.text %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>**</p>
  
  <blockquote>
    <p>The code for create_posts.rb</p>
  </blockquote>
  
  <p>**</p>
  
  <pre><code>class CreatePosts &lt; ActiveRecord::Migration
    def change
      create_table :posts do |t|
        t.string :title
        t.text :text
  
        t.timestamps
      end
  end
  </code></pre>
  
  <p>Please help me out why this error is coming up </p>