Does this only happen in Rails? I can't reproduce it with this code: http://gist.github.com/429328
I'm not actually entirely sure what the problem is. Is it that the block value is returned wrong? How so, exactly? On Mon, Jun 7, 2010 at 3:11 PM, topfunky <[email protected]>wrote: > I frequently write my own Ruby methods that take a block and return a > string. > > TidyTable.new(@data).to_html do |record| > record.title > end > > This worked fine in Haml 2 like this: > > = TidyTable.new(@data).to_html do |record| > - record.title > > But now it tells me "TidyTable block expects an Array or Hash, but a > Fixnum was returned." It appears that Haml is trying to turn all block > content into strings. > > I can fix it by using curly braces on the same line, but that's a > hack. It should work with a regular Ruby block. > > Is this a bug? How should I go about fixing it in Haml 3? > > Details: > > Haml 3.0.10 > Rails 2.3.2 > RubyGems 1.3.7 > Ruby 1.8.7 > > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected] <haml%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/haml?hl=en.
