Ruby on Rails
Thursday, July 29, 2010
<% @items.each do |item| %> <div class="item<%= item.id %>">
<%= item.record-name %>
</div> <% end %>
I think it goes model.method action |table| tuple.relvar.
I took the logic from here
I'm a newbian refuge as well.
-- On Thu, Jul 29, 2010 at 5:40 PM, Eddie Du <lists@ruby-forum.com> wrote:
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.
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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment