html - Display data in columns not rows using Ruby on Rails -


I would like to display data in columns instead of rows in my web page

Ruby on Rail What is the most effective way to use it?

Many thanks for your help!

Using an array will be a simple solution to rotate the information. Like this (pseudo) code (can not check ATMs)
Controller code:

  @stuffs = Stuff.find (: all) @rotated = [] @ rotated [0] = [] #Stuff Column 0 @ Rotate [1] = [] #Stuff Column # 1 Index Index = 0 # Now Easy to Store (ier) Access @ stuffs.each do | @ Rattified [0] [index] = content.formatt0 @ breadcrumbs [1] [index] = content.extension1 index + = 1 end  

In your view, you need something like this: / P>

  & lt; Table & gt; Table head here! & Lt;% 2.times do Row | & Gt%; #Bild tables (we have 2 luggage details, so 2 here) & lt; Tr & gt; & Lt;% index.times | Column | & Gt%; & Lt; Td> & Lt;% = @rotated [row] [column]%> & gt; & Lt; / Td> & Lt;% end% & gt; & Lt; / TR & gt; & Lt;% end% & gt; & Lt; Table & gt;  

Definitely a better solution, but it seems to me the simplest / simple to rotate some data from some models.

As with the others, we have been told that we can help you, maybe better!


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -