I want to dynamically display a list of items, but the number of items by row depends on the width of the screen. the number inside each_slice depends on the screen size... if large screen:
<% @posts.each_slice(3) do |s| %>
<div class="row">
<% s.each do |p| %>
<div class="small-12 medium-6 large-4 columns">
if medium screen:
<% @posts.each_slice(2) do |s| %>
<div class="row">
<% s.each do |p| %>
<div class="small-12 medium-6 large-4 columns">
Anyone knows how to have a js variable in
each_slice("javascript vairable")
Thank you