Hi Matt,
Thanks again for your tips! I tried out your approach, but I would
have to manually tell Hobo/DRYML when to execute the array or hash tag
etc. What I would like, is for the DRYML execution engine to somehow
decide whether to apply a HashMap wrapper or an Array wrapper
depending on the context (number of child elements). My approach seems
to solve this, except the "wrappers" are generated directly into the
erb code, instead of being the result of executing the erb code later
(well I guess strings -> string is also a kind of execution/
transformation!).
Another question:
How would I let DRYML apply the equivalent of automatic tag
inheritance with super() calls?
I would like a tag to be defined to inherit from another tag, and have
it call that tag automatically before or after applying its own
"logic", and the super-tag to be called with the parameters relevant
for it (attrs_for[:supertag]. Should I use a similar core DRYML
template extension approach IYO? or can I solve it using the before-*,
append-*, after-*, restore-* replace constructs of DRYML or sth
similar?
I was thinking something along the lines of
<def tag="circle" inherits-before="figure">..
circle
</def>
<def tag="square" inherits-after="figure">..
square
</def>
<def tag="figure">
-figure:
</def>
<circle/> would render as: -figure:circle
<square/> would render as: square-figure:
Thanks!
- Kris
PS: I don't really get the scope.retval and scope.vals in your
example, and how it magically creates the => from the Hash, <%
scope.vals << Hash[key, value] %>
Trying to convert the ruby '=>' into javascript equivalent ':'
Something like:
<% (scope.vals << Hash[key, value]).to_s.gsub!(/=>/, ':') %>
But it doesn't work :(
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---