Re: [Rails] Simple View Template Question

2010-07-30 Thread Michael Pavling
On 30 July 2010 03:48, Angel Robert Marquez wrote: > <% @items.each do |item| %> > <%= item.record-name %> > <% end %> >> I'm trying to render a list of div's with ids "item1", "item2", "item3", If you're specifically after "item1" rather than "item", then you can use "each_with_index": <% @i

Re: [Rails] Simple View Template Question

2010-07-30 Thread Colin Law
On 30 July 2010 01:40, Eddie Du 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 %> > > > .. blah blah .. > > > <% end %> > > Pretty sure the syntax is wrong. I couldn't find the answer after >

Re: [Rails] Simple View Template Question

2010-07-29 Thread Angel Robert Marquez
<% @items.each do |item| %> <%= item.record-name %> <% 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 and applied the solution for post to your prob

[Rails] Simple View Template Question

2010-07-29 Thread Eddie Du
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 %> .. blah blah .. <% 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