I am new to Ruby/HAML and am attempting to simplify a partial syntax for my simple requirements. For example, I want to create a partial that will pass variables to output the following HTML:
<figure class="foo">
<img src="path/to/img.png" />
<figcaption>caption text here</figcaption>
</figure>
I'm looking to create a helper to get the partial syntax to something approximating:
@(figure).foo {
img: "path/to/img.png",
caption: "caption text here"
}
Is a syntax this simple possible? Is there a better approach?