-
-
Save sshkarupa/a2085fb286833aedaed6 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 | |
slim :template_partial, :layout => false | |
else | |
# renders as normal inside layout.html | |
slim :template_partial | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment