Hello, all. I have a question that I'm hoping a Haml/Ruby expert can help
me with.
I have created some helper methods, called "container", "row", and "col"
that follow a strict hierarchy:
= container do
= row do
= col do
%p content
= col
And the methods, defined in a module, generally look like this:
def container(attrs = {}, &block)
capture_haml do
haml_tag(:table, attrs) do
block.call
end
end
end
I would like to be able to leave out intermediary steps when they don't
have any individual content, for example:
= container do
= col do
%p content
= col
^ Here, the row() is implied.
The question is, is there a way to query the Haml structure, perhaps by
creating a state variable somewhere on the Ruby side? I have played around
with the block.call() and creating a supplementary class, but haven't
succeeded yet. Do I need to monkey-patch the Haml library? I'm wondering
what is the best way to go about doing this, or if it's even possible.
Suggestions?
Thanks,
Eric
--
You received this message because you are subscribed to the Google Groups
"Haml" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/haml.
For more options, visit https://groups.google.com/groups/opt_out.