scaffolding+will_paginate+提供will_paginate下载

首先应安装will_paginate
ruby script/plugin install vn://errtheblog.com/svn/plugins/will_paginate 
然后就开始进行简单的代码改写:
controller:
@posts = Post.paginate :page => params[:page]||1, :per_page => 5
view\index:
<%= will_paginate @posts, :prev_label   => '上一页',
      :next_label   => '下一页' %>
如果安装没有显示错误但是<程序名>/vendor/plugins/will_paginate始终是空的的话,就下载will_paginate然后解压放到那里就成了,下载在附件里

下面这个网址有更详细的说明
http://www.cnblogs.com/ayuan/articles/1102001.html

你可能感兴趣的:(html,SVN,Ruby)