Commit 712b5f51cbe4ca4b882b4104bb41e48273e333c9

Authored by Rodrigo Souto
2 parents 840db72a 15080d64

Merge branch 'ai2977' into 'stable'

Don't render layout for javascript format

This is the default behaviour for Rails when rendering .js.erb files. Check http://stackoverflow.com/questions/4060300/when-rendering-js-erb-file-it-renders-layout-with-the-javascript-is-it-a-bug
Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
app/controllers/application_controller.rb
... ... @@ -21,6 +21,7 @@ class ApplicationController < ActionController::Base
21 21 include ApplicationHelper
22 22 layout :get_layout
23 23 def get_layout
  24 + return nil if request.format == :js
24 25 theme_layout = theme_option(:layout)
25 26 if theme_layout
26 27 theme_view_file('layouts/'+theme_layout) || theme_layout
... ...