title: how to display posts with even/odd number?
body: <p>I want to display posts with even number or odd number in a page I tried everything but still didn't work, any help is much appreciated.
  I am using <code>devise</code> for User model.</p>
  
  <p>posts controller</p>
  
  <pre><code>    class PostsController &lt; ApplicationController
      def new
          @post = Post.new
        end
      def index
          @posts = Post.all
        end
  
        def show
          @post = Post.find(params[:id])
        end
        def delete
        end
      end
  </code></pre>