title: how to find the current_user voted for the post? acts_as_votable rails
body: <p>I have the following code in my view:</p>
  
  <p>if <code>current_user.voted_for? post</code> => gives me undefined method voted_for?</p>
  
  <p>How can I find the <code>current_user</code> is <code>voted</code> for the <code>post</code>?</p>
  
  <h2>Routes:</h2>
  
  <pre><code>  resources :posts do
      resources :comments, only: [:index, :new, :create]
      member do
        get "like", to: "posts#upvote" 
        get "dislike", to: "posts#downvote" 
      end
    end
  </code></pre>
  
  <h2>Controller:</h2>
  
  <pre><code>def upvote
      @post.upvote_by current_user
      redirect_to :back
    end
  
    def downvote
      @post.downvote_by current_user
      redirect_to :back
    end
  </code></pre>
  
  <h2>View:</h2>
  
  <pre><code>  &lt;% @posts.each do |post| %&gt;
      &lt;div class="vote-box"&gt;
        &lt;p class="up"&gt;
          &lt;% if post.voted_for? current_user %&gt;
            &lt;%= link_to(like_post_path(post), method: :get) do %&gt;
              &lt;i class="entypo-up-dir"&gt;&lt;/i&gt;
            &lt;% end %&gt;
          &lt;% else %&gt;
            &lt;%= link_to(dislike_post_path(post), method: :get) do %&gt;
              &lt;i class="entypo-up-dir upvoted"&gt;&lt;/i&gt;
            &lt;% end %&gt;
          &lt;% end %&gt;
        &lt;/p&gt;
        &lt;p class="vote_count_text"&gt;
          &lt;%= post.get_upvotes.size %&gt;
        &lt;/p&gt;
     &lt;/div&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p>I tried <code>current_user.likes?</code> <code>, voted_up_on?</code> and several methods as per the gem tutorial but no luck.</p>
  
  <p>Thanks</p>