Select doenst pass the correct value

Hello,

I have in my view a select tag that doesnt return the right value, could
anyone point me what am I doing wrong?

Heres whats in my view

<%=select “”, “situacao”, {“Open”=>0,“Closed”=>
1},:include_blank=>true%>

Then in my controller I do this

def status
if request.post?
#Do some stuff
@situacao = params[:situacao]
#some more code
end
end

The problem is that params[:situacao] always returns 0, even when I pick
“Closed”
Any help?

coelho

Hi,

coelho coelho wrote:

<%=select “”, “situacao”, {“Open”=>0,“Closed”=> 1},:include_blank=>true%>

What is the empty string for? If you put something into it,

<%=select “foo”, “situacao”, {“Open”=>0,“Closed”=>
1},:include_blank=>true%>

you can use

@situacao = params[:foo][:situacao]

Lutz

Hi Lutz

Thank you, it worked fine the way said

<%=select “foo”, “situacao”, {“Open”=>0,“Closed”=>
1},:include_blank=>true%>

But now in the same form I have a date select that is always returning
nil …

Data Inicio
<%= date_select(“foo”, “data_ini”, :order=>[:day, :month, :year]) %>

whats wrong there?

Coelho