Gregory Brown
Posts: 172
Nickname: greg7224
Registered: Nov, 2005
|
Gregory Brown is the author of Ruby Reports (ruport)
|
|
|
|
Ruport Says to Rails, “Holla Back!”
|
Posted: Feb 23, 2006 1:37 PM
|
|
>> dump = Album.find(:all).map { ¦e¦ e.attributes }
=> [{”composer”=>”bar”, “title”=>”Foo”, “id”=>1, “producer_id”=>1},
{”composer”=>”Banana”, “title”=>”Apple”, “id”=>2, “producer_id”=>1}]
>> my_ds = dump.to_ds(dump[0].keys)
=> .. it returns a dataset but my blog is eating this
>> my_ds.to_csv
=> “composer,title,id,producer_id\nbar,Foo,1,1\nBanana,Apple,2,1\n”
Read: Ruport Says to Rails, “Holla Back!”
|
|