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:
on 2006-06-04 23:05
on 2006-06-04 23:06
Sorry feb-19: Item_1 feb-20: Item_2 How would I go about doing that?
on 2006-06-05 13:39
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.
on 2006-06-05 13:43
I forgot to mention smth: the data u wrote I assumed to be part of "examples" table from your db.