I guess the following is a better solution?

Inside a tag, the parameters variable contains a hash of Proc, one for
each parameter (tag)
parameters = [:a => Proc(a), :b => Proc(b), ...]

<panel>
  <a>hello</a>
  <b>blip</b>
</panel>

<def tag="panel" ...>
<%
checklist = []
<a: param>
checklist << :a
%>
<%= comma?(params, checklist) %>
<% checklist << :b %>
<b: param>
<%= comma?(params, checklist) %>
<% checklist << :c %>
<c: param>
%>

util.rb
-------

def comma?(params, checklist)
  "," if any_content?(params, checklist)
end

def any_content?(params, checklist)
  checklist.each do |sym|
    return true unless params[:checklist].call.blank?
  ënd
  false
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to