<% @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 http://guides.rails.info/getting_started.html#rest <http://guides.rails.info/getting_started.html#rest>and applied the solution for post to your problem. I'm a newbian refuge as well. On Thu, Jul 29, 2010 at 5:40 PM, Eddie Du <[email protected]> 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 [email protected] %> > > <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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<rubyonrails-talk%[email protected]> > . > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

