Created
October 24, 2011 00:01
-
-
Save aaronmoodie/1308100 to your computer and use it in GitHub Desktop.
Sinatra: render template partial without layout when requested va Ajax
This file contains 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
if request.xhr? | |
# renders :template_partial without layout.html | |
erb :template_partial, :layout => false | |
else | |
# renders as normal inside layout.html | |
erb :template_partial | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment