Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9115551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:27:34+00:00 2026-06-17T04:27:34+00:00

In my views, I am rendering a partial. This is actually a row element

  • 0

In my views, I am rendering a partial. This is actually a row element that shows up in a table some 500 – 600 times. I have eager loaded all associations.
But, the issue is, same partial takes abruptly different render-time some times.

My rails server o/p:

Rendered admin/invoices/_update.html.erb (1330.3ms)
Rendered admin/invoices/_update.html.erb (4.8ms)
Rendered admin/invoices/_update.html.erb (4.8ms)
Rendered admin/invoices/_update.html.erb (8.8ms)
Rendered admin/invoices/_update.html.erb (4.4ms)
Rendered admin/invoices/_update.html.erb (1309.9ms)
Rendered admin/invoices/_update.html.erb (4.7ms)
Rendered admin/invoices/_update.html.erb (4.6ms)
Rendered admin/invoices/_update.html.erb (4.6ms)
Rendered admin/invoices/_update.html.erb (1322.6ms)
Rendered admin/invoices/_update.html.erb (4.2ms)

Also, there is no particular row that takes longer every time.

In my view file:

<% @updates.each do |update| %>
<%= render :partial => 'update', :locals => {:user => update[0]} #each of this is  a row %>
<% end %>

UPDATE:
Also suggest if this a good way to do this? i.e: looping over a partial so many times. I can’t use pagination and Ajax to fasten up things.! Any other approach.?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:27:36+00:00Added an answer on June 17, 2026 at 4:27 am

    Though I’m not sure why the lag spikes in the rendering, i strongly recomend inverting the order: You give all the updates to the partial and inside it you iterate and render the rows.

    In view file

        <%= render :partial => 'update', :locals => {:updates => @updates} %>
    

    And inside the update partial

        <% updates.each do |update| %>
           RENDER LOGIC
        <% end %>
    

    This why you don’t suffer the partial loading overhead for every row in your update. Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problems with partial rendering in Rails. This is in my routes.rb:
In an MVC3 application I have a view rendering two Ajax partial views: a
I have a few partial views that should render when the user has a
I have an MVC 3 page that has two partial views, one for Items
I have a rails partial that renders a sidebar for users. As part of
This works, because it returns the result of partial view rendering in a string:
so i have a problem with :partial rendering... I have: index.html.erb view with content
I have ten or more view where I could use this: @Html.Partial(_Stats) or: 20-30
This is my code for rendering the partial (the @parties collection is being generated
I have a controller which renders a view (~/Views/Component/Create.aspx) no problem. When this view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.