title: Couldn't find Comment without an ID - polymorphic associations
body: <p>The error appears when I try to submit a comment. - ActiveRecord::RecordNotFound in CommentsController#index - I followed <a href="http://railscasts.com/episodes/154-polymorphic-association-revised" rel="nofollow">this</a> and <a href="http://guides.rubyonrails.org/association_basics.html#polymorphic-associations" rel="nofollow">this</a> tutorial</p>
  
  <p>the URL is:</p>
  
  <pre><code>.../articles/1/comments
  </code></pre>
  
  <p>comments_controller</p>
  
  <pre><code>class CommentsController &lt; ApplicationController
   before_action :set_comment
   before_action :signed_in_user, only: [:new]
  
  def index
    @commentable = load_commentable
    @comments = @commentable.comments
  end
  
  ...
  
   def create
    @comment = @commentable.comments.new(comment_params)
    @comment.user = current_user
  
   if @comment.save
    redirect_to @comment, notice: "Comment created."
   else
    render :new
   end
  end
  
  ....
  
  private
  
  def load_commentable
    resource, id = request.path.split('/')[1, 2]
    @commentable = resource.singularize.classify.constantize.find(id)
  end
  
  def set_comment
    @comment = Comment.find(params[:id])
  end
  ....
  </code></pre>
  
  <p><a href="http://justpaste.it/exca" rel="nofollow">Full trace:</a></p>