Skip to content

Instantly share code, notes, and snippets.

@djanowski
Created December 23, 2008 18:57
Show Gist options
  • Select an option

  • Save djanowski/39420 to your computer and use it in GitHub Desktop.

Select an option

Save djanowski/39420 to your computer and use it in GitHub Desktop.
get '/posts/:id' do
# Render with or without a layout depending
# on request#xhr?. Useful for rendering regular
# requests and also partial updates like:
# $("#post").load('/posts/1')
haml :'posts/show', :layout => !request.xhr?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment