What is wrong here? Trying to call a tag dynamically...
console output:
---------------
parameters
attributes
TAG: hd
ActionView::TemplateError (undefined method `hd' for
#<ActionView::Base:0x3946008>) on line #20 of app/views/front/
index.dryml:
front/index.dryml
-----------------
<comp title="A">
<hd:><msg>HEADER</msg></hd>
<ft:>FOOTER</ft>
</comp>
application.dryml
-----------------
<def tag="comp" attrs="title">
comp(<%= ": #{title}" %>) {
<hd param="hd"/>
<ft param="ft"/>
<%= join_params(parameters, attributes, [:hd, :ft], ", ")
%>
}
</def>
<def tag="msg">
<do param="default"/>
</def>
<def tag="hd">
<do param="default"/>
</def>
<def tag="ft">
<do param="default"/>
</def>
---
application_helper.rb
---------------------
module ApplicationHelper
def join_params(parameters, attributes, list, join_str)
results = []
list.each do |sym|
# how do I pass on the parameters and attributes for a given
param Proc?
tag = sym.to_s
# using call-tag from rapid core.dryml
res = send(tag.gsub('-', '_'), attributes, parameters)
results << res
end
results.join(join_str)
end
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---