Hi,

I have my Find statement returning rows like this

Col1 Col2 Col3 Col4

While displaying I want to do this order: Cyclic fashion.

First row: Col1 Col2 Col3 Col4

Second row: Col2 Col3 Col4 Col1

Third row: Col3 Col4 Col1 Col2

Fourth row: Col4 Col1 Col2 Col3

I thought of doing modulo 4 on column index. But I don't knw how to

access columns by index.

I tried this but with no luck:

@rows = matrx.find(:all)

<% for mat_row in @rows %>

<%= h(truncate(mat_row[i modulo 4], 80)) %>

<%= h(truncate(mat_row[(i + 1)modulo 4], 55)) %>

<%= h(truncate(mat_row[(i+2)modulo 4], 55)) %>

<%= h(truncate(mat_row[(i+3)modulo 4], 55)) %>

<% end %>

Regards,

Sandeep