title: How to fix nil:NilClass error in polymorphic-associations?
body: <p>This is my comment controller code</p>
  
  <pre><code> private
          def set_commentable
              @commentable = Question.find(params[:question_id])
              @commentable = Comment.find(params[:comment_id])
          end
  </code></pre>
  
  <p>I've tried but i'm getting below error, I hope I did error in passing of comment id </p>
  
  <pre><code>undefined method `set_comment' for #&lt;CommentsController:0xb34e3348&gt;
  </code></pre>