Skip to content

Instantly share code, notes, and snippets.

View jrgifford's full-sized avatar
:shipit:
This is like AIM all over again, isn't it?

James Gifford jrgifford

:shipit:
This is like AIM all over again, isn't it?
View GitHub Profile

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

*.* -crlf
/home/jrg/code/snowypenguinsolutions/ClientName/communityengine/test/testapp/Rakefile
== CreateUsers: migrating ====================================================
-- create_table("users")
-> 0.0053s
== CreateUsers: migrated (0.0054s) ===========================================
== AddActivationCodeToUser: migrating ========================================
-- add_column(:users, :activation_code, :string, {:limit=>40})
-> 0.0008s
-- add_column(:users, :activated_at, :datetime)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DemoApp</title>
<meta name="description" content="">
<meta name="author" content="">
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<h2>Comments</h2>
<% @article.comments.each do |comment| %>
<p>
<strong>Commenter:</strong>
<%= comment.commenter %>
</p>
<p>
<strong>Comment:</strong>
<%= comment.body %>
</p>
<%= form_for([@article, @article.comments.build]) do |f| %>
<p>
<%= f.label :commenter %><br />
<%= f.text_field :commenter %>
</p>
<p>
<%= f.label :body %><br />
<%= f.text_area :body %>
</p>
<p>
If you had problems to use the gem therubyracer on Ubuntu 12.04LTS after install
$gem install therubyracer
You just need to delete v8 library before install therubyracer, so...
$gem uninstall libv8
$gem install therubyracer
ok... if you did that and the rails still asking "Please install gem therubyracer", don't worry. Just edit the gemfile:
@jrgifford
jrgifford / init.pp
Created March 19, 2013 14:16 — forked from loe/init.pp
class rsyslog {
include logrotate::rsyslog
package { 'rsyslog':
ensure => installed
}
service { 'rsyslog':
ensure => running
}
Start of Heisenbug logging ======================================
# Logfile created on 2013-03-02 08:21:02 -0500 by logger.rb/31641
Started GET "/users/user_225" for 127.0.0.1 at 2013-03-02 08:21:02 -0500
Processing by UsersController#show as HTML
Parameters: {"id"=>"user_225"}
Rendered shared/_pagination.haml (0.1ms)
Rendered updates/_list.html.haml (1.1ms)
Rendered users/show.haml within layouts/application (9.9ms)
Rendered shared/_head.html.haml (2.8ms)
Rendered shared/menu/_main.haml (9.7ms)
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/home/james/.rbenv/versions/2.0.0-p0
## --------- ##
## Platform. ##