Check_box_tag


#1

Hi,

i want select some attribute of a Model to work.
The model has this attributes
(tipo,pun,sm3,quantity,corrispettivo,importo) So i used:

<% for @variable in Model.column_names() %>
<%= check_box_tag (:key,@variable) %>
<%end%>

but if i use in the controller,this code:

@stats=Model.column_names()
for @cerca in @stats
if (@params[:scelta]==‘tipo’ or @params[:scelta]==‘quantity’)
@risultato=“ok”
end
end

the variable @risultato will be ‘ok’ only if i selected the attribute
‘tipo’.
While if i selected the attribute quantity, @risultato will be ‘ok’ only
if quantity has been select alone.

What’s the problem?

Ivan.