You should be able to use any Ruby expression in the Hash portion:

%html
 %head
 %body
 #outer
  #navigation
   %ul.navigation
    - @data["name"].each do |name|
      %li
        %a{:href => "\##{name}"}= name
  #content
   - @data.each do |name, content|
    .panel{:id => name)
       = content

Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


On Thu, Apr 8, 2010 at 7:59 AM, Shaz <[email protected]> wrote:

> I have in ruby:
>
> @data =
> --> {"name"=>["one", "two", "three"], "content"=>["content for 1",
> "content for 2", "content for 3"]}
>
> And I want to call it in HAML:
>
> %html
>  %head
>  %body
>  #outer
>   #navigation
>    %ul.navigation
>     -...@data["name"].each do |name|
>      %li
>       %a(href="\##{name}") #{name}
>   #content
>    [email protected] do |name, content|
>     .panel(id="#{name}")
>      #{content}
>
> Essentially be able to show the content with the name?
>
> --
> 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.

Reply via email to