<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cory O&#039;Daniel - These are just words &#187; csv</title>
	<atom:link href="http://coryodaniel.com/index.php/tag/csv/feed/" rel="self" type="application/rss+xml" />
	<link>http://coryodaniel.com</link>
	<description>Software development, thoughts, and randomness</description>
	<lastBuildDate>Wed, 01 Sep 2010 18:49:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An Excel CSV exporter for ActiveRecord</title>
		<link>http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/</link>
		<comments>http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 02:55:08 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=424</guid>
		<description><![CDATA[This is a mix of two blog posts on exporting ActiveRecord data to CSV.  This explicitly was designed to export stuff so excel wouldn't freak out.
This strips new lines from any string field, set the BOM and converts the encoding to utf16.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
require &#34;fastercsv&#34;
require &#34;iconv&#34;
&#160;
# Excel info from: http://blog.plataformatec.com.br/2009/09/exporting-data-to-csv-and-excel-in-your-rails-app/?utm_source=feedburner&#38;utm_medium=feed&#38;utm_campaign=Feed:+PlataformaBlog+(Plataforma+Blog)
# Original post: http://www.brynary.com/2007/4/28/export-activerecords-to-csv
&#160;
# Usage:
#   [...]]]></description>
			<content:encoded><![CDATA[<p>This is a mix of two blog posts on exporting ActiveRecord data to CSV.  This explicitly was designed to export stuff so excel wouldn't freak out.</p>
<p>This strips new lines from any string field, set the BOM and converts the encoding to utf16.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;fastercsv&quot;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;iconv&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Excel info from: http://blog.plataformatec.com.br/2009/09/exporting-data-to-csv-and-excel-in-your-rails-app/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed:+PlataformaBlog+(Plataforma+Blog)</span>
<span style="color:#008000; font-style:italic;"># Original post: http://www.brynary.com/2007/4/28/export-activerecords-to-csv</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Usage:</span>
<span style="color:#008000; font-style:italic;">#   Given User is an ActiveRecord model</span>
<span style="color:#008000; font-style:italic;">#   </span>
<span style="color:#008000; font-style:italic;">#   Options for Model.to_csv, Array.to_csv, and ActionController::Base#send_csv</span>
<span style="color:#008000; font-style:italic;"># </span>
<span style="color:#008000; font-style:italic;">#   :only     - Array, trumps :exclude. Only these attributes will be included instead of all attributes (things listed in :methods will still be sent)</span>
<span style="color:#008000; font-style:italic;">#     :only =&gt; [ :id, :name, :created_at ]</span>
<span style="color:#008000; font-style:italic;">#   :methods  - Array, additional methods to evaluate and add to the CSV response. Note: you can send nested method calls</span>
<span style="color:#008000; font-style:italic;">#     :methods =&gt; [ :to_s, :complex_method, &quot;my.method.on.a.related.object&quot;]</span>
<span style="color:#008000; font-style:italic;">#   :exclude  - Array, attributes to exclude from CSV result</span>
<span style="color:#008000; font-style:italic;"># </span>
<span style="color:#008000; font-style:italic;">#  From ActionController</span>
<span style="color:#008000; font-style:italic;">#     send_csv User, :only =&gt; [:first_name, :email, :created_at] #This will do all records</span>
<span style="color:#008000; font-style:italic;">#     send_csv User.all(:conditions =&gt; [&quot;created_at &gt; ?&quot;, some_date]), :only =&gt; [:first_name, :email, :created_at]</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;">#  From ActiveRecord Model</span>
<span style="color:#008000; font-style:italic;">#   User.to_csv :only =&gt; [ :username, :email, :created_at ], :methods =&gt; [ :age, &quot;account.id&quot;] # All users additionally get their related Account#id number</span>
<span style="color:#008000; font-style:italic;">#   User.all(:limit =&gt; 10).to_csv :exclude =&gt; [:password, :birthdate]</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Shortcut for CSV of whole table</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">to_csv</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">*</span>args<span style="color:#006600; font-weight:bold;">&#41;</span>
    find<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:all</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_csv</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">*</span>args<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Get the column headers</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">csv_columns</span><span style="color:#006600; font-weight:bold;">&#40;</span>options=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    tmp_columns = <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:only</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:only</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;">#only trumps exclude</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">content_columns</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>curr_col<span style="color:#006600; font-weight:bold;">|</span> curr_col.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#006600; font-weight:bold;">-</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:exclude</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>curr_col<span style="color:#006600; font-weight:bold;">|</span> curr_col.<span style="color:#9900CC;">to_s</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    tmp_columns <span style="color:#006600; font-weight:bold;">+</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:methods</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>curr_col<span style="color:#006600; font-weight:bold;">|</span> curr_col.<span style="color:#9900CC;">to_s</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Record to a row level csv array</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> to_csv<span style="color:#006600; font-weight:bold;">&#40;</span>options=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">csv_columns</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>curr_col<span style="color:#006600; font-weight:bold;">|</span>
      curr_col = curr_col.<span style="color:#9900CC;">to_s</span>  
&nbsp;
      <span style="color:#008000; font-style:italic;">#Its a chain of method calls, on intermediary nil, just return nil</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> !curr_col.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        col_val = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>curr_col<span style="color:#006600; font-weight:bold;">&#41;</span> 
      <span style="color:#9966CC; font-weight:bold;">else</span>
        col_val = <span style="color:#0000FF; font-weight:bold;">self</span>
        curr_col.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>curr_method<span style="color:#006600; font-weight:bold;">|</span> col_val = col_val.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>curr_method<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> col_val.<span style="color:#0000FF; font-weight:bold;">nil</span>?<span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      col_val.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span>, <span style="color:#996600;">&quot; &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> col_val.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">String</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># Strip newlines, Appease Excel Gods      </span>
      col_val
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">Array</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Convert an array of objects into a CSV String.</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> to_csv<span style="color:#006600; font-weight:bold;">&#40;</span>options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    column_options    = <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:only</span>    <span style="color:#006600; font-weight:bold;">=&gt;</span> options.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:only</span><span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:exclude</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> options.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:exclude</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
      <span style="color:#ff3333; font-weight:bold;">:methods</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> options.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:methods</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
    options = <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:col_sep</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#008000; font-style:italic;"># Appease Excel Gods</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">merge</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> all? <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>e<span style="color:#006600; font-weight:bold;">|</span> e.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:to_csv</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      header_row = first.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">csv_columns</span><span style="color:#006600; font-weight:bold;">&#40;</span>column_options<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_csv</span>
&nbsp;
      content_rows = map <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>e<span style="color:#006600; font-weight:bold;">|</span> 
        <span style="color:#008000; font-style:italic;"># Get all the values of non-excluded rows</span>
        e.<span style="color:#9900CC;">to_csv</span><span style="color:#006600; font-weight:bold;">&#40;</span>column_options<span style="color:#006600; font-weight:bold;">&#41;</span> 
      <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>r<span style="color:#006600; font-weight:bold;">|</span> 
        <span style="color:#008000; font-style:italic;"># Call to_csv on the array of row-level values, this will join them into a CSV row</span>
        r.<span style="color:#9900CC;">to_csv</span><span style="color:#006600; font-weight:bold;">&#40;</span>column_options<span style="color:#006600; font-weight:bold;">&#41;</span> 
      <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>header_row<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> content_rows<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">join</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      FasterCSV.<span style="color:#9900CC;">generate_line</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>, options<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
<span style="color:#008000; font-style:italic;"># module for extending ActionController</span>
<span style="color:#9966CC; font-weight:bold;">module</span> ExcelCSVExporter
  BOM = <span style="color:#996600;">&quot;<span style="color:#000099;">\3</span>77<span style="color:#000099;">\3</span>76&quot;</span> <span style="color:#008000; font-style:italic;">#Byte Order Mark, Appease Excel Gods</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> send_csv<span style="color:#006600; font-weight:bold;">&#40;</span>kollection, options=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    filename = options.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:filename</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> I18n.<span style="color:#9900CC;">l</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>, <span style="color:#ff3333; font-weight:bold;">:format</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:short</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;.csv&quot;</span>
&nbsp;
    content = kollection.<span style="color:#9900CC;">to_csv</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Appease Excel Gods</span>
    content = BOM <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#CC00FF; font-weight:bold;">Iconv</span>.<span style="color:#9900CC;">conv</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;utf-16le&quot;</span>, <span style="color:#996600;">&quot;utf-8&quot;</span>, content<span style="color:#006600; font-weight:bold;">&#41;</span>
    send_data content, <span style="color:#ff3333; font-weight:bold;">:filename</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> filename    
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">ActionController::Base</span>.<span style="color:#9900CC;">send</span> <span style="color:#ff3333; font-weight:bold;">:include</span>, ExcelCSVExporter</pre></td></tr></table></div>

<p>Wanna use it?</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> MyCoolController <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActionController::Base</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> index
    respond_to <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>want<span style="color:#006600; font-weight:bold;">|</span>
      want.<span style="color:#9900CC;">csv</span><span style="color:#006600; font-weight:bold;">&#123;</span> send_csv MyCoolModel.<span style="color:#9900CC;">all</span>, <span style="color:#ff3333; font-weight:bold;">:exclude</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:secret_column</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#ff3333; font-weight:bold;">:methods</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:complex_method</span>, <span style="color:#996600;">&quot;related.table.method&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p align="left"><a class="tt" href="http://twitter.com/home/?status=An+Excel+CSV+exporter+for+ActiveRecord+http://bit.ly/b23yXZ" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/&amp;title=An+Excel+CSV+exporter+for+ActiveRecord" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/&amp;t=An+Excel+CSV+exporter+for+ActiveRecord" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/&amp;title=An+Excel+CSV+exporter+for+ActiveRecord" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/&amp;title=An+Excel+CSV+exporter+for+ActiveRecord" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/01/27/an-excel-csv-exporter-for-activerecord/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
