I think you want to use capture_haml instead of haml_concat. http://github.com/nex3/haml/tree/db1faf446dc9798d8b3a87cfaedf119e614b20e4/lib/haml/helpers.rb#L256
chris On Thu, Dec 11, 2008 at 6:43 PM, MarcusJ <[email protected]> wrote: > > I am new to Haml (as of yesterday), but am very much enjoying it. I > have converted almost an entire rails project, but I am stuck on a > couple of my helpers which I would like to convert to use the nicely > indented output of Haml. > > As an example, I have the following helper for displaying flash > messages: > > def flash_messages > flash.each do |key,value| > haml_tag :div, { :id => "flash_#{key}" } do > haml_concat value > end > end > end > > This is working provided that in my views I call it as > > - flash_messages > > I feel like this should really be > > = flash_messages > > to be consistent with Rails conventions and the way I interpret views. > I have tried a half-dozen variations to achieve this, but none seem to > work. Any suggestions are appreciated as I have many of these and I > only want to use the "silent" syntax on helpers that have blocks > associated with them. The rest I would like to use the "=". > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
