分页插件(will_paginate)是非常好用的,但是安装的时候没有安装svn客户端,会出现安装不了的情况,所以提供了附件供不方便安装的朋友下载
1:安装:
ruby script/plugin install svn://errtheblog.com/svn/plugins/will_paginate 或者下载附件解压到:vendor/plugins中即可.
2:使用
controller
@posts = Post.paginate :page => params[:page]||1, :per_page => 50
view
<%= will ...
- 13:35
- 浏览 (588)
- 论坛浏览 (3057)
- 评论 (11)
- 分类: rails
rails的插件列表
http://agilewebdevelopment.com/plugins/list
竟然有900多个插件!
下面是我用过的两个:
FileColumn
作用:文件上传,和rmagic综合试用
网页:http://www.kanthak.net/opensource/file_column/
Acts as attachment
作用:文件上传
网页:http://technoweenie.stikipad.com/plugins/show/Acts+as+Attachment
有时间把其它的翻译一下,看是干什么用的,以后就方便了!如果有路过的用过其它插件 ...
- 15:43
- 浏览 (756)
- 论坛浏览 (855)
- 评论 (3)
- 分类: rails
- 发布在 ror-party 圈子
def index
table = Ruport::Data::Table.new :data => [["dd","男",3], [3,4,5]],
:column_names => %w[姓名 性别 年龄]
puts table.to_csv #-------1
send_data table.to_csv,
:type => "application/csv",
:disposition => "inline",
:filename => "report ...
- 13:41
- 浏览 (249)
- 论坛浏览 (714)
- 评论 (4)
- 分类: rails
1, install:
gem install ruport -y
gem install ruport-util -y
2, require
在 environment.rb 中,写入: require "ruport"
3, Loading acts_as_reportable
在model中: 例如
引用class Report < ActiveRecord::Base
acts_as_reportable
end
4, code
在controller中:
引用def index
&nb ...







评论排行榜