Collection.each { |x| puts x} in rhtml?

Been trying to use the short format for a collection in rhtml, i.e.

<% collection.each {|x| puts x} %>

Doesn’t seem to work though [outputs nothing]

?

puts doesn’t work in erb…

try…

<% collection.each do |x| %>
<%= x %>
<% end %>

<% collection.each do |x| %>
<%= x %>
<% end %>

in your .mab:

comment.each(&:text) or whatever…

On 30-May-06, at 2:35 PM, brez! !! wrote:

Been trying to use the short format for a collection in rhtml, i.e.

<% collection.each {|x| puts x} %>

Doesn’t seem to work though [outputs nothing]

?

Hey,

how about <%= collection.join %>

Trevor

Trevor S.
http://somethinglearned.com