Displaying array elements in order

Hi,

for example

a=[12,354,633,68,85]
<%for i in a%>
<%z=Document.find(i)%>
<%=z.name%>
<%end%>

Here the result is displaying randomly in browser
but i want to display the result in the array order
i.e first 12 then followed by 354,633,68,85

If you have any solution pla reply

Try

a=[12,354,633,68,85].sort

or

<%for i in a.sort %>

–wpd

On Tue, Jul 15, 2008 at 5:31 AM, Pragash Mr.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs