Commit 15080d64f57344abc092af40b61d8a24a1caeb85
1 parent
2d698f0b
Exists in
master
and in
28 other branches
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 | ... | ... |