Conditions

Hello again people,

I am trying to retrieve some results from my mysql db using conditions
derived from a form’s select input. I have a “room” table with amongst
others a “rent_amount” column. The code I use to retrieve the rooms that
where searched for based on a maximum rent amount is:

@results = Room.find(:all, :conditions => [“rent_amount = ?”,
params[“search[rent_amount]”]])

I also tried using the following code:

@results = Room.find(:all, :conditions => [“rent_amount = ?”,
params[:search_rent_amount]])

Both of these do not come up with any results… Is there something
obvious I’m doing wrong here?

Thanks in advance,

Danny

Never mind… Always just when you are desperate enough to forum post
your question it seems like the answer presents itself five minutes
later…

had to use: params[:search][:rent_amount]

:slight_smile:

l8rs