I am new to Rails and going through a twitter web application.
The "next" and "supporters" of the application are excellent. However, I want to filter out the Posts index to only show posts that the current user is following.
I need to do something line by line:
@posts = Post.where('user_id LIKE ?', current_user.friendships )
As I expected, this causes an error
SQLite3::SQLException: near ",": syntax error: SELECT "posts".* FROM "posts" WHERE (user_id LIKE 8,9)
It seems to me that I want, because 8.9 is the identifier of my friends.
Any suggestions on the best way to get what I'm looking for?
Thank!
source
share