title: Rails 3 current user id to comments?
body: <p>So Im working on a rails app where users can comment on photos or videos another user has uploaded and so far everything is great except I am not able to get the current user_id associated with the person who has commented on the post. This is what I have so far. </p>
  
  <p>user.rb</p>
  
  <pre><code>has_many :comments,  :dependent =&gt; :destroy
  </code></pre>
  
  <p>photo.rb</p>
  
  <pre><code>has_many :comments, :as =&gt; :commentable
  </code></pre>
  
  <p>video.rb</p>
  
  <pre><code>has_many :comments, :as =&gt; :commentable
  </code></pre>
  
  <p>comments_controller.rb</p>
  
  <pre><code>def create
    @commentable = find_commentable
    @comment = @commentable.comments.build(params[:comment])
   if @comment.save
     redirect_to :id =&gt; nil, :notice =&gt; "Successfully created comment."
   else
     render :action =&gt; 'new'
   end
  end
  </code></pre>
  
  <p>How can I get the user id to appear with the current comments? I have the comment type and comment id I am just looking for a way to have it so the user_id can appear. Any suggestions?</p>