[rails] Find by parameter

Hi,

I’m trying to do a query on controller for get list by a boolean value

I do

@movies = Movie.where(:active => 1)

This value is already on form and it is being written on database, but
when
I write a block, I still picked up the list of all videos

Can anyone see what I’m doing wrong?

Thanks!


Fernando A.

hi,

did you try Movie.where(:active => true) ? (if your column is boolean)

you can try in your console…

or could try Movie.where(“active = 1”)

tom

On Jun 21, 2011, at 20:41 , Fernando A. wrote:

Can anyone see what I’m doing wrong?
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz

Yeah. Works with Movie.where(:active => true)

Thanks!