Skip to content

Instantly share code, notes, and snippets.

@dummied
Created May 5, 2009 12:55
Show Gist options
  • Save dummied/106955 to your computer and use it in GitHub Desktop.
Save dummied/106955 to your computer and use it in GitHub Desktop.
# A paginated list of recently-added photos
def index
@photos = Photo.paginate(
:per_page => 36,
:page => page,
:order => "photos.created_at DESC"
)
respond_to do |format|
format.html {
render :action => "list"
}
format.js {
render :json => @photos.to_json
}
format.xml {
render :xml => @photos.to_xml
}
format.atom {
render :action => "list"
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment