Forum: Ruby on Rails Could you tell me

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E13ba8e702211be152c640df2d8e141f?d=identicon&s=25 joe-black <allenbobo@gmail.com> (Guest)
on 2005-11-29 17:19
Hi guys
I met a situation like this:

ids = params[:ids]
Blog.find(:all,
          :conditions=>["id in (?)", ids])

debug, sql is:
SELECT * FROM blogs WHERE (id in ('8,6'))

any guy can tell me how to solve this kind of problem

all regards
Af95bdaf87958c40150b813e94381bfd?d=identicon&s=25 Christer Nilsson (christer)
on 2005-11-29 17:41
Blog.find(ids) would solve this problem.
This topic is locked and can not be replied to.