title: Having error while letting users post comments and loading comments on a page
body: <p>I get the following error:</p>
  
  <pre><code>syntax error, unexpected keyword_end, expecting end-of-input
  </code></pre>
  
  <p>This is my Comments_controller file, </p>
  
  <pre><code>class CommentsController &lt; ApplicationController
    def create
      @post = Post.find(params[:post_id])
      @comment = @post.comments.build(params[:comment])
      @comment.save
  
      redirect_to @posts
  
    end
  
    def destroy
    end
  
    end
  end
  </code></pre>
  
  <p>This is the HTML for using it, </p>
  
  <pre><code>&lt;h1&gt;&lt;%= @post.title %&gt;&lt;/h1&gt;
  
  &lt;%= @post.text %&gt;
  &lt;h2&gt;Comments&lt;/h2&gt;
  
  &lt;% @post.comments.each do |comment| %&gt;
      &lt;p&gt;&lt;%= comment.text %&gt;&lt;/p&gt;
      &lt;p&gt;&lt;%= time_ago_in_words comment.created_at %&gt; ago &lt;/p&gt;
  &lt;% end %&gt;
  
  &lt;%= form_for [@post, @post.comments.build] do |f| %&gt;
      &lt;p&gt;&lt;%= f.text_area :text, :size =&gt; "40x10" %&gt;&lt;/p&gt;
      &lt;p&gt;&lt;%= f.submit "Post Comment" %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  
  &lt;p&gt;
  &lt;%= link_to "Back", posts_path %&gt;
  |
  &lt;%= link_to "Edit", edit_post_path(@post) %&gt; 
  |
  &lt;%= link_to "Delete", @post, method: :delete, data: { confirm: 'Are you sure?' } %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>So when the user post's comments or when the user tries to load comments page this error occurs.</p>