Permalink
Browse files

Don't use layout when requested from xhr

  • Loading branch information...
1 parent 28fd867 commit eb34327ab5983d7a9c10c74d851fa02ebc905c07 @tricknotes tricknotes committed Jan 4, 2013
@@ -3,7 +3,7 @@
class Rails::InfoController < ActionController::Base # :nodoc:
self.view_paths = File.expand_path('../templates', __FILE__)
prepend_view_path ActionDispatch::DebugExceptions::RESCUES_TEMPLATE_PATH
- layout 'application'
+ layout -> { request.xhr? ? nil : 'application' }
before_filter :require_local!
@@ -174,8 +174,9 @@
<script>
function about() {
var info = document.getElementById('about-content'),
- xhr = new XMLHttpRequest();
- xhr.open("GET","rails/info/properties",false);
+ xhr = new XMLHttpRequest();
+ xhr.open("GET", "rails/info/properties", false);
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.send("");
info.innerHTML = xhr.responseText;
info.style.display = 'block'

0 comments on commit eb34327

Please sign in to comment.