Skip to content

Instantly share code, notes, and snippets.

@aaronmoodie
Created October 24, 2011 00:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aaronmoodie/1308100 to your computer and use it in GitHub Desktop.
Save aaronmoodie/1308100 to your computer and use it in GitHub Desktop.
Sinatra: render template partial without layout when requested va Ajax
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