Displaying 1 result from an estimated 1 matches for "screen_id".
Did you mean:
screen2d
2008 Jan 24
4
using object.find() in a loop not returning an array
...wever, this
code simply is overwriting the instance variable with each iteration.
Why? I want to end up with an array or hash in the instance var so I
can iterate through it in my view to display.
***CODE****
for scr in scrns
@scrs = Screen.find(:all, :conditions => [ "id = ?", scr.screen_id ])
end
***CODE****
I''ve tried modifying the statement above in multiple ways:
***CODE****
@scrs << Screen.find( blah blah
@scrs += Screen.find( blah blah
Screen.find( blah blah).collect blah
***CODE****
Nothing is working. Any ideas?
--
Posted via http://www.ruby-forum.com/....