title: show hide of rows inside a helper in a rails project
body: <p>I am running a loop in my helper method.</p>
  
  <p>Which gives me a result like after 6 items the row closes and then for next 6 items another row gets created and this goes on.</p>
  
  <p>Now I want to have another condition where If there's more than 2 rows, I don't want to show the third or fourth loop, instead I want to put a link/button which says show more and on Its click display other items.</p>
  
  <p>here's the code</p>
  
  <pre><code> part_child_option.  each_slice(6) do | six_o|
    html += "&lt;div class = 'row'&gt;"
    six_o.each do |o|
    html += "&lt;div class='col-sm-2 uno_part_wrapper'&gt;"
    html += "&lt;label class = 'p_name' for='#{attr_name}'&gt;"
      html += image_tag o.photo(:small), class: "tick_option_img"
        html += "&lt;/label&gt;"
        html += "&lt;/div&gt;"
     end 
        html += "&lt;/div&gt;"
     end
   html.html_safe
  </code></pre>
  
  <p>Any idea on this. Can we put a condition like if <code>count&gt;2</code>, hide remaining rows and on click show all.</p>