From: why the lucky stiff Date: 2004-12-22T08:11:14+09:00 Subject: Re: html form generation problems Dennis Roberts wrote: > This works! Thanks. What is the difference between each and collect? > With each it still didn't work, but it did with collect. The `each' method merely walks an Array (or other Enumerable.) But `collect' (a.k.a `map') walks the Array, replacing each element with the result from the block. At the end of `collect', you have a new Array. So, in the cgi example, you started with an array of: ['one', 'two', 'three'] The `collect' processes each through the `text_field' method and you wind up with: ["", "", ""] _why