Created
August 14, 2011 21:48
-
-
Save durango/1145351 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable :layout for any ajax request | |
# (easily allows you to support browsers with/without JS) | |
# Same concept can be applied to render, erb, etc. | |
module Sinatra | |
class Base | |
def haml(template, options={}); options.merge!(:layout => false) if request.xhr?; super; end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment