title: Devise - how to show user's post
body: <p>I use Devise gem for authentication.</p>
  
  <p>In database I have users table and posts table in my database schema (and Post controller).
  In post controller I want to find all posts assigned to specific user. I have user_id in posts table.</p>
  
  <p>How to get all user's posts or how to check if specific post is assigned for SIGNED IN user.</p>
  
  <p>I thought about something like this (of course is only pseudocode:</p>
  
  <blockquote>
    <p>current_user.id == Post.where(params:[post_id]).user_id</p>
  </blockquote>
  
  <p>So how to get current user id in Devise and how to check the current user id is the same like eg. user_id assigned to viewing post (I want to add 'edit' function when current user is post owner) and how to find all post which current user is owner.</p>