heroku - Rails memory leak due to all function -


so keep getting memory leak. believe because have table in view shows whole database (whole database being 23k rows)

is there method use without getting memory leak on heroku constantly?

heres have

  def index     @newevents = event.order("id").page(params[:page]).per(100)     @ready = event.all   end 

i cant tell 1 causing issue, haven't thought making 'event.all' paginated whgich may fix bit?

sam

edit

view

<h1>events do</h1> <table class="table">     <thead>       <tr>         <th>id</th>         <th>eventname</th>         <th>date</th>         <th>time</th>         <th>link</th>       </tr>     </thead>     <tbody>       <% @newevents.each |ne| %>       <% if ne.eventready.blank?%>       <tr>         <td><%= ne.id %></td>         <td><%= ne.eventname %></td>         <td><%= ne.date %></td>         <td><%= ne.time %></td>         <td><%= link_to "edit event", edit_event_path(ne.id), class: "btn btn-info" %></td>       </tr>       <% end %>       <% end %>      </tbody>   </table> <%= paginate @newevents %> <h1>events made</h1> <table class="table">     <thead>       <tr>         <th>id</th>         <th>eventname</th>         <th>date</th>         <th>time</th>         <th>link</th>       </tr>     </thead>     <tbody>       <% @ready.each |co| %>       <% if co.eventready.present?%>       <tr>         <td><%= co.id %></td>         <td><%= co.eventname %></td>         <td><%= co.date %></td>         <td><%= co.time %></td>         <td><%= link_to "edit event", edit_event_path(co.id), class: "btn btn-info" %></td>       </tr>       <% end %>       <% end %>      </tbody>   </table> 


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -