Commit 1cf37958ac2ac7ffeecb97fbc95c5cf2c0210a9e

Authored by Braulio Bhavamitra
Committed by Rodrigo Souto
1 parent 6ca84615

Don't render layout on ajax requests

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/controllers/application_controller.rb
@@ -21,7 +21,8 @@ class ApplicationController < ActionController::Base @@ -21,7 +21,8 @@ class ApplicationController < ActionController::Base
21 include ApplicationHelper 21 include ApplicationHelper
22 layout :get_layout 22 layout :get_layout
23 def get_layout 23 def get_layout
24 - return nil if request.format == :js 24 + return nil if request.format == :js or request.xhr?
  25 +
25 theme_layout = theme_option(:layout) 26 theme_layout = theme_option(:layout)
26 if theme_layout 27 if theme_layout
27 theme_view_file('layouts/'+theme_layout) || theme_layout 28 theme_view_file('layouts/'+theme_layout) || theme_layout