[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Create checkboxes on page using contents of a hash

sig_UVA

5/10/2006 3:26:00 PM

Hi all,

I have a hash that is created in the index method of my controller.
After it is created, the index.rhtml page is rendered. Upon this
rendering I would like to create a check box for each key/value in the
hash.

The has is @recordsHash

I have been trying varying stratagies like the one below, but to no
avail. Do you have any ideas? Thanks for your help on this!

html lang='en">

<head>

</head>

<body>

Some text here


</br>


<%= form_tag(:controller => "AddMassMail", :action => 'addmassmail') %>

<% @recordsHash.each do {|key, value| %>
<%= "Site #{value}<%= check_box('Site', '#{key}', {:checked
=> 'checked'}, 'yes') %> <% } %>


<%= submit_tag("Add Mass Mailing") %>

<%= end_form_tag %>

</body>

</html>

1 Answer

Matt Sidesinger

5/10/2006 10:44:00 PM

0

*** This post is a duplicate of one found in Ruby On Rails ***

Please place all future replies here:
http://groups.google.com/group/rubyonrails/browse_frm/thread/a57efebcaaa83f0e/0e7d97e97f9cbff4#0e7d97...