I would like to disply a list of posts of selected users.
From the following code, User.find_by… will return an array that holds
And then I want to select the list of the posts with the user_id stored
in the array.
However, “user_id LIKE @user” doesn’t work.
This is somewhat I expected, but I don’t know how to solve this.
Please help me
@user = User.find_by… # find_by… function returns multiple user
conditions = [“user_id LIKE ?”, @user]
@post_pages, @posts = paginate :posts, :order => ‘id DESC’, :conditions
=> conditions, :per_page => post_per_page