Create checkboxes on page using contents of a hash

S

sig_UVA

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,675
Latest member
RollandKna

Latest Threads

Top