pager_controller.rb
来自「ruby on rails web敏捷开发之路第二版 源代码」· RB 代码 · 共 48 行
RB
48 行
#---# Excerpted from "Agile Web Development with Rails, 2nd Ed."# We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information.#---class PagerController < ApplicationController def populate User.delete_all ["Chris Pine", "Chad Fowler", "Dave Thomas", "Andy Hunt", "Adam Keys", "Maik Schmidt", "Mike Mason", "Greg Wilson", "Jeffrey Fredrick", "James Gray", "Daniel Berger", "Eric Hodel", "Brian Marick", "Mike Gunderloy", "Ryan Davis", "Scott Davis", "David Heinemeier Hansson", "Scott Barron", "Marcel Molina", "Brian McCallister", "Mike Clark", "Esther Derby", "Johanna Rothman", "Juliet Thomas", "Thomas Fuchs"].each {|name| User.create(:name => name)} 763.times do |i| User.create(:name => "ZZUser #{"%03d" % i}") end end def user_list @user_pages, @users = paginate(:users, :order => 'name') end end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?