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] ? -- Posted via http://www.ruby-forum.com/.
subimage interactive
2006-May-30 21:55 UTC
[Rails] collection.each { |x| puts x} in rhtml?
puts doesn''t work in erb... try... <% collection.each do |x| %> <%= x %> <% end %> On 5/30/06, brez! !! <jbresnik@gmail.com> 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] > > ? > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- seth at subimage interactive http://www.subimage.com/sublog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060530/a8e77493/attachment.html
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 Squires http://somethinglearned.com> > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails