# How to deal with array of checkbox values in Ruby 1.9.1?

**URL:** <https://www.ruby-forum.com/t/how-to-deal-with-array-of-checkbox-values-in-ruby-1-9-1/186012>\
**Category:** Rails\
**Created:** [March 30, 2010, 12:49pm UTC](https://www.ruby-forum.com/t/how-to-deal-with-array-of-checkbox-values-in-ruby-1-9-1/186012 "2010-03-30T12:49:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikrogroove](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d6d6ee/32.png) [@mikrogroove](https://www.ruby-forum.com/u/mikrogroove)\
**Post date:** [March 30, 2010, 12:49pm UTC](https://www.ruby-forum.com/t/how-to-deal-with-array-of-checkbox-values-in-ruby-1-9-1/186012/1 "2010-03-30T12:49:31Z")

</div>

In Ruby 1.9.1 strings are no longer enumerable and string.each is  
undefined. This causes a problem when parsing values for an array of  
generated checkboxes since the field value, when submitted, becomes an  
array of strings. For example:

\<% for map in Map.find(:all) %\>  
\<%= check\_box\_tag “listing[map\_ids][]”, map.id, @listing.maps.include?  
(map) %\>  
\<%= map.title %\>  
\<% end %\>

This will result in an error, undefined method `each’ for “1”:String,  
in process\_parameter\_filter because map\_ids is being passed as  
“map\_ids”=\>[“1”,“2”] (if checkboxes with values 1 and 2 have been  
checked that is).

What is the recommended way to fix this?
