title: How to get actual post.id while using friendly_id
body: <p>I currently have my post model using friendly_id to replace <code>Post.id</code> with <code>Post.pid</code>: 
  <code>friendly_id :pid, :use =&gt; :scoped, :scope =&gt; :id</code></p>
  
  <p>How can I get the actual id of a post instead of the slug so that when a reply saves it saves <code>Post.id</code> and not <code>Post.slug</code> to <code>Reply.post_id</code>.</p>
  
  <p>I need to do this because replies are appearing to posts created on other boards due to <code>post.pid</code> not being unique </p>
  
  <pre><code>class RepliesController &lt; ApplicationController
    def create
      @board = Board.friendly.find(params[:board_id])
      @post = Post.friendly.find(params[:post_id])
      @reply = @post.replies.create(reply_params)
      @post.touch
      redirect_to @board
    end
    private
      def reply_params
        params.require(:reply).permit(:name, :email, :subject, :comment, :reply_file)
      end
  end
  </code></pre>