Ruby on rails foreach with bootstrap3 row class -
I will push the loop through the data and would like to display the usage of this data to the bootstrap grid system, Column, though I'll need it for several rows for the amount of data given below:
& lt; Div class = "row" & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; * Data goes here & lt; / Div & gt; & Lt; / Div & gt; Can someone give advice on how to use a forerunner in the rail, obviously, only 1 would have to be presented below. All Cold MD-4 items will return in class and class. I give it another one. After creating an ORO class, it will reach 3 items per line and start again. I hope that makes sense! What have I done so far: & lt; Div class = "row" & gt; & Lt;% @ work.each do | W | & Gt%; & Lt; Div class = "col-md-6" & gt; & Lt;% = w.image_url% & gt; & Lt; / Div & gt; & Lt;% end% & gt; & Lt; / Div & gt;
use
& lt;% @work Every_slice (3) do it. Works | & Gt%; & Lt; Div class = "row" & gt; & Lt;% works.each do | Work | & Gt%; & Lt; Div class = "col-md-4" & gt; * Work.name * & lt; / Div & gt; & Lt;% end% & gt; & Lt; / Div & gt; & Lt;% end% & gt;
Comments
Post a Comment