try
<% @key=''key''+i.to_s%>
or simply
<%= radio_button_tag (''key'' + i.to_s,@obj) %>
also I guess ''0'' and ''1'' need to be replaced
to 0 and 1 (no apostrophes)
otherwise you will get 0, 01, 011, 0111 etc. hashes
On 3/24/06, Ivan Medda <avemedda@tin.it> wrote:>
> Hi,
>
> I''ve a little problem using the Radio Button Tag.
> I use the " @prove=MODEL.column_names() " to keep attribute names
of a
> table. After
> i used this code to select a attribute subsets of them :
>
> <% i=''0''%>
> <% for @obj in @prove %>
> <% @key='':key''+i%>
> <%= radio_button_tag (@key,@obj) %>
> <% i=i+''1'' %>
> <% end %>
> <%= submit_tag ("calca") %>
> <%= end_form_tag %>
>
> But when i come back to the controller, it''is impossible select
the
> right radio button value with the code :
>
> @result=@params[@key];
>
> The compiler don''t understand the Hash key that i used!.
> The compiler want to use something such as: radio_button_tag (:key,@obj)
> ;
>
> Some ideas?
>
> --
> 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/2a79235b/attachment.html