Select post list of multiple user_id

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
multiple users.
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 :slight_smile:

@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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs