Skip to main content

SQLite3::SQLException: no such column:

Rails • Asked by Hilldamn

I'm trying to make a blogging app with rails and I'm currently trying to add a comment section. When I tried looking on one of my blogs it gave me this error.

ActiveRecord::StatementInvalid in Posts#show

SQLite3::SQLException: no such column: comments.post_id
Extracted source (around line #16):


Comments

<%= render @post.comments %>

Add a Comment:

<%= render 'comments/form' %>

I have no I idea of what's going on.


Since it says your comments table has no post_id column, you should check your migrations and make sure you didn't forget to add the column. :)


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.