Skip to content

Instantly share code, notes, and snippets.

@flexd

flexd/app.rb Secret

Created November 29, 2011 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flexd/a12f3f64a249c09eafc9 to your computer and use it in GitHub Desktop.
Save flexd/a12f3f64a249c09eafc9 to your computer and use it in GitHub Desktop.
Application (shortened)
get '/' do
@articles = Article.paginate(:page => params[:page], :per_page => 3)
haml :articles
end
%ul.articles
- @articles.each do |article|
%li
%a{:href=>"/article/#{article.id}"}=article.title
= will_paginate @articles
= will_paginate @articles
%ul.articles
- @articles.each do |article|
%li
%a{:href=>"/article/#{article.id}"}=article.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment