hi, What''s the right way to use the CHECK_BOX_TAG? I used: <% for @pippo in @model %> <%= check_box_tag (:scelta,@pippo) %> <% end %> How Can I control if a person choosen the second or third element of the vector @pippo? -- Posted via http://www.ruby-forum.com/.
You need to use this form
<%= check_box_tag(''scelta[]'', @pippo) %>
then in controller you can access params[:scelta] as collection which you
can iterate through and do the required checks
On 3/24/06, Ivan Medda <avemedda@tin.it> wrote:>
> hi,
>
> What''s the right way to use the CHECK_BOX_TAG?
>
> I used:
>
> <% for @pippo in @model %>
> <%= check_box_tag (:scelta,@pippo) %>
> <% end %>
>
> How Can I control if a person choosen the second or third element of the
> vector @pippo?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060324/e94e13ff/attachment.html
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. -- Posted via http://www.ruby-forum.com/.