Forum: Ruby on Rails check_box_tag

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A6be7720d668f4f02160b600e67337e2?d=identicon&s=25 Ivan Medda (Guest)
on 2006-03-27 11:44
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.
This topic is locked and can not be replied to.