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]
?
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 S.
http://somethinglearned.com
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs