Skip to content

Instantly share code, notes, and snippets.

@karmi
Created July 24, 2008 09:24
Show Gist options
  • Save karmi/2095 to your computer and use it in GitHub Desktop.
Save karmi/2095 to your computer and use it in GitHub Desktop.
get '/:post_id' do
last_modification_of_post = Blog::Post[ params[:post_id], {:only => ['id', 'updated_on']} ]
last_modified( last_modification_of_post.updated_on ) if last_modification_of_post
@post = Blog::Post[ params[:post_id] ]
throw :halt, [404, erb(not_found) ] unless @post
erb :post
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment