Skip to content

Instantly share code, notes, and snippets.

@jocap
Created December 6, 2010 18:57
Show Gist options
  • Save jocap/730732 to your computer and use it in GitHub Desktop.
Save jocap/730732 to your computer and use it in GitHub Desktop.
get '/archive' do
@articles = Article.all :limit => 10, :order => 'created_at'
erb :articles # or haml, whatever
end
get '/archive/:permalink' do |permalink|
@article = Article.first :permalink => permalink
erb :article
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment