I found a way. I used Jquery to check the size of the window with: (coffee script)
n=2
if $('body').width() > 1025
n = 3
if $('body').width() > 640
$(".break:nth-child("+n+"n").addClass "row"
the html.erb looks like this:
<div class="row">
<% @posts.each do |p| %>
<div class="break">
<div class="small-12 medium-6 large-4 columns">
and then with jquery I select the nth div and add a class row. It is not prefect but it works.