process a list of values

13 views
Skip to first unread message

CaniVIZ Andéor

unread,
Nov 19, 2014, 4:01:47 PM11/19/14
to webgen...@googlegroups.com
Hi all,

I have a page and I would like to generate a list of similar <div> from a list of values. I am completely new to webgen, I am figuring that I could add some ruby code with a for-each like function applied onto a list of values. In pseudo code this could be

<code>
for-each v in 'a', 'b', 'c', do
  display '<div>' + v + </div>
end
</code>

Is it is the best way to do, and where could I find some information?

Thanks in advance

Guilhem

Thomas Leitner

unread,
Feb 2, 2015, 11:16:24 AM2/2/15
to webgen...@googlegroups.com
On 2014-11-19 13:01 -0800 CaniVIZ Andéor wrote:
> Hi all,
>
> I have a page and I would like to generate a list of similar <div>
> from a list of values. I am completely new to webgen, I am figuring
> that I could add some ruby code with a for-each like function applied
> onto a list of values. In pseudo code this could be
>
> <code>
> for-each v in 'a', 'b', 'c', do
> display '<div>' + v + </div>
> end
> </code>

Yeah, you could just do:

<% ['a', 'b', 'c'].each do |item| %>
Some html and the value is <%= item %>
<% end %>

Best regards,
Thomas
Reply all
Reply to author
Forward
0 new messages