sql - Rails 3 where query -


i sending array jquery via url requerts rails controller.

when in controller

log_array = (params[:log_ids]) logger.debug "this array #{log_array.to_a}" 

i in server log

this array 85,84,83,82 

i trying query selected logs:

@logs = log.where(['"logs"."id" in (?)', log_array]) 

i on server log

select "logs".* "logs" ("logs"."id" in ('85,84,83,82')) 

it sould this

select "logs".* "logs" ("logs"."id" in (85,84,83,82)) 

it seems puts arry in string.

is there way make sql right array?

or log.where(:id => params[:log_ids]) if want use where() goodness.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -