Here's how I'd do it:
- flash.each do |name, msg|
%div{:id => "flash_#"}= msg
Or, if you want to use content_tag, you might as well make
it a helper:
def flash_display
flash.each do |name, msg|
open :div, msg, :id => "flash_#"
end
end
Then put in your template:
- flash_display
Malko wrote:
> Hello All,
>
> First off, I love haml/sass and it's changing the way I
work for the
> better, but I'm having some problems wrapping my head
around
> something.
>
> <% flash.each do |name, msg| %>
> <%= content_tag :div, msg, :id =>
"flash_#" %>
> <% end %>
>
> Take that for example, I can't quite figure out how to
make that
> display correctly without getting a "can't convert
nil into String"
> error. Anyone have some advice?
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to haml googlegroups.com
To unsubscribe from this group, send email to
haml-unsubscribe googlegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---
|