Say, for example, I have this in my db: id name date 1 Item_1 feb-19 2 Item_2 feb-20 and I want to manipulate it so that the view can output this: feb-19: Item1 feb-20: -- Posted via http://www.ruby-forum.com/.
Sorry feb-19: Item_1 feb-20: Item_2 How would I go about doing that? -- Posted via http://www.ruby-forum.com/.
Maybe smth like that: def list @examples = Example.find(:all) end <!--list.rhtml--> <ul> <%for ex in @examples%> <li><%= ex.date%>: <%ex.name%></li> <%end%> </ul> Also I think it''s better to change your column name from "date to "created_at"/"updated_at" or add them both. -- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060605/82089f30/attachment.html
I forgot to mention smth: the data u wrote I assumed to be part of "examples" table from your db. -- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060605/3388a476/attachment-0001.html