Progressive Render

#33 Progressive Render
6/13/2016

Summary

Slow content got you down? Load it later! Use this gem to defer loading of portions of your page until after load. They will be fetched via AJAX and placed on the page when ready.
3
rails performance ajax view

Summary

Gemfilegem 'progressive_render'
application.js//= require progressive_render

If you plan on using the default loader, you will need to also include the CSS asset.

application.css*= require progressive_render
visitors_controller.rbclass VisitorsController < ApplicationController
  def index
    @users = User.all
    progressive_render
  end

  def images
    # Some task
    progressive_render
  end

  def census
    # Some task
    progressive_render
  end
end
views<%= progressive_render do %>
  Slow loading content here...
<% end %>



00000000000000000000000000000000?d=mm&f=y&s=64
frank004 said 3 months ago:

This is great. I was trying it out it work out of the box but all js inside the block stop running, no error on the js console but stop working maybe the (document).ready(function() ) is not finish.

635114?v=3&s=64
kobaltz said 3 months ago:

Is the JS in your view or in the assets?

Login to Comment