Ruby on Rails Thursday, July 29, 2010

I'm trying to render a list of div's with ids "item1", "item2", "item3",
etc..
Trying to do it like this:

<% for i in 0...@items.size %>

<div id="item<%= i %>" >
.. blah blah ..
</div>

<% end %>

Pretty sure the syntax is wrong. I couldn't find the answer after
googling for a bit - perhaps I'm too new and dont know where to look.

Help please?
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment