title: Globally override default layout option in render method Sinatra
body: <p>I'm loading in div content from views with AJAX. I want to set the :layout => false in my erb method if request.xhr? is true. I have:</p>
  
  <pre><code>get '/' do
    erb :index, :layout =&gt; !request.xhr?
  end
  </code></pre>
  
  <p>in all of my routes... but this (:layout => !request.xhr?) becomes repetitions and I want to DRY this out.</p>
  
  <p>How would you suggest I remedy this? Should I open Sinatra::Base and override the render method? If so, how? Is there a good way to write a before filter that checks to see if the request coming in is an AJAX request? I feel like I've tried just about everything I can but I am still not getting the desired output of :layout => false if request.xhr? is true</p>
  
  <p>Any ideas would be greatly appreciated :)</p>