How do I prevent the application layout from rendering twice when doing an XHR request?

52 Views Asked by At

I want to populate the landing page of my app with index pages of other controllers using xhr calls whenever someone loads the homepage. However, whenever I try doing this, the layout gets rendered twice multiple times. I have tried a couple of things mentioned in other answers like:

class ApplicationController < ActionController::Base
  layout proc { false if request.xhr? }

but my page is still loading the layout multiple times. What can I do to get around this?

0

There are 0 best solutions below