Tags to iterate over a list

16 views
Skip to first unread message

Errol Siegel

unread,
Dec 4, 2013, 12:36:35 PM12/4/13
to radia...@googlegroups.com
Say, for example, that I want to output a list like this:

<ul>
<li><span class="some-class">Something</span> - More text - <span class="other-class">even more text</span></li>
<li><span class="some-class">Something</span> - More text - <span class="other-class">even more text</span></li>
<li><span class="some-class">Something</span> - More text - <span class="other-class">even more text</span></li>
</ul>

Are there any built-in tags (or known extensions) for iterating over a list like that? It would be nice to avoid duplicating all those tags for a long list.

I know I can just write my own tags to do this, but before I do so I wanted to see if this feature already exists.

Thanks!

Jim Gay

unread,
Dec 4, 2013, 12:47:12 PM12/4/13
to radia...@googlegroups.com
Errol,
It's not clear to me which parts you expect to be different.
We have iterators like children:each but there's nothing that takes an
arbitrary set of data for iteration.

Are you looking for something like this?
<r:iterate collection="…">
<r:item>…
This doesn't exist. But it's hard for me to understand what you want
the radius code to look like. Can you give an example of that?

-Jim


--
Write intention revealing code #=> http://www.clean-ruby.com

Jim Gay
Saturn Flyer LLC
571-403-0338

Errol Siegel

unread,
Jan 8, 2014, 4:42:41 PM1/8/14
to radia...@googlegroups.com
I thought I posted a reply to this a long time ago, but I don't see it here anywhere.

Anyhow, thanks for your reply to my question. I suspected that there was not a set of tags for what I was trying to do. I wrote my own simple tag extension to take care of it.

Thanks again.
Reply all
Reply to author
Forward
0 new messages