Check all - check box problem


#1

I am not able to create a check box or a button that can check and
uncheckall the check boxes that i have created. It can be a check box
or button that checks and unchecks all the check boxes.

<% i = 0 %> <% @hotels.each do |hotel| %> <%= check_box('hotel_', '', {}, hotel.group_name+i.to_s, '') %> <% i = i + 1 %> <% end %>

thanks in advance,
Czar


#2

I think the best way is to use javascript for checking and unchecking
all. Here is a good example that worked for me when I was doing
something similar.
http://snippets.dzone.com/posts/show/2818
also railscasts.com has a good screencast on checkboxes you might find
helpful.