acts_as_xlsx 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +12 -4
- data/Rakefile +6 -0
- data/doc/Axlsx.html +6 -4
- data/doc/Axlsx/Ar.html +35 -8
- data/doc/Axlsx/Ar/ClassMethods.html +14 -14
- data/doc/Axlsx/Ar/SingletonMethods.html +41 -41
- data/doc/_index.html +7 -4
- data/doc/css/style.css +10 -10
- data/doc/file.CHANGELOG.html +67 -0
- data/doc/file.LICENSE.html +3 -3
- data/doc/file.README.html +43 -32
- data/doc/file_list.html +3 -0
- data/doc/frames.html +1 -1
- data/doc/index.html +43 -32
- data/doc/js/app.js +4 -4
- data/doc/top-level-namespace.html +3 -3
- data/lib/acts_as_xlsx.rb +6 -94
- data/lib/acts_as_xlsx.rb~ +0 -0
- data/lib/acts_as_xlsx/ar.rb +95 -0
- data/lib/acts_as_xlsx/version.rb +6 -0
- data/lib/acts_as_xlsx/version.rb~ +5 -0
- data/test/acts_as_xlsx.sqlite3.db +0 -0
- data/test/helper.rb~ +9 -0
- data/test/tc_acts_as_xlsx.rb~ +0 -0
- metadata +73 -42
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -44
- data/acts_as_xlsx.gemspec +0 -34
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
File: CHANGELOG
|
8
|
+
|
9
|
+
— acts_as_xlsx: a rails plug in for axlsx
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="_index.html" title="Index">Index</a> »
|
37
|
+
<span class="title">File: CHANGELOG</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a id="class_list_link" href="#">Class List</a>
|
46
|
+
|
47
|
+
<a id="method_list_link" href="#">Method List</a>
|
48
|
+
|
49
|
+
<a id="file_list_link" href="#">File List</a>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
<div class="clear"></div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<iframe id="search_frame"></iframe>
|
56
|
+
|
57
|
+
<div id="content"><div id='filecontents'>
|
58
|
+
</div></div>
|
59
|
+
|
60
|
+
<div id="footer">
|
61
|
+
Generated on Tue Dec 6 18:49:18 2011 by
|
62
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
63
|
+
0.7.4 (ruby-1.8.7).
|
64
|
+
</div>
|
65
|
+
|
66
|
+
</body>
|
67
|
+
</html>
|
data/doc/file.LICENSE.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: LICENSE
|
8
8
|
|
9
|
-
—
|
9
|
+
— acts_as_xlsx: a rails plug in for axlsx
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -82,9 +82,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
82
82
|
</div></div>
|
83
83
|
|
84
84
|
<div id="footer">
|
85
|
-
Generated on
|
85
|
+
Generated on Tue Dec 6 18:49:18 2011 by
|
86
86
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
87
|
-
0.7.
|
87
|
+
0.7.4 (ruby-1.8.7).
|
88
88
|
</div>
|
89
89
|
|
90
90
|
</body>
|
data/doc/file.README.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
—
|
9
|
+
— acts_as_xlsx: a rails plug in for axlsx
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -63,9 +63,9 @@
|
|
63
63
|
<strong>Author</strong>: Randy Morgan <br/>
|
64
64
|
<strong>Copyright</strong>: 2011 <br/>
|
65
65
|
<strong>License</strong>: MIT License <br/>
|
66
|
-
<strong>Latest Version</strong>: 1.0.
|
66
|
+
<strong>Latest Version</strong>: 1.0.3 <br/>
|
67
67
|
<strong>Ruby Version</strong>: 1.8.7 - 1.9.3<br/>
|
68
|
-
<strong>Release Date</strong>: December
|
68
|
+
<strong>Release Date</strong>: December 6th 2011</p>
|
69
69
|
|
70
70
|
<h2>Synopsis</h2>
|
71
71
|
|
@@ -73,7 +73,7 @@
|
|
73
73
|
|
74
74
|
<h2>Feature List</h2>
|
75
75
|
|
76
|
-
<p>**1. Mixes into active record base to provide to_xlsx
|
76
|
+
<p>**1. Mixes into active record base to provide to_xlsx</p>
|
77
77
|
|
78
78
|
<p>**2. Can work at the end of any series of finder methods.</p>
|
79
79
|
|
@@ -81,23 +81,28 @@
|
|
81
81
|
|
82
82
|
<p>**4. Automates localization of column heading with i18n support</p>
|
83
83
|
|
84
|
-
<p>**5. Lets you specify columns
|
84
|
+
<p>**5. Lets you specify columns and methods chains you want to call to populate your table in one go.</p>
|
85
85
|
|
86
86
|
<p>**6. Gives you access to the axlsx package so you can add styles, charts and pictures to satisfy those flashy sales guys.</p>
|
87
87
|
|
88
88
|
<p>**7. Plays nicely with both ruby 1.8.7 + rails 2.3 as well as ruby 1.9.3 + rails 3</p>
|
89
89
|
|
90
|
+
<p>**8. Automatically registers xlsx Mime type for use in respond_to web-service support.</p>
|
91
|
+
|
90
92
|
<h2>Installing</h2>
|
91
93
|
|
92
94
|
<p>To install, use the following command:</p>
|
93
95
|
|
94
|
-
<pre class="code">$ <span class='
|
96
|
+
<pre class="code">$ <span class='rubyid_gem identifier id'>gem</span> <span class='rubyid_install identifier id'>install</span> <span class='rubyid_acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
95
97
|
</pre>
|
96
98
|
|
97
99
|
<h2>Usage</h2>
|
98
100
|
|
99
101
|
<h3>Examples</h3>
|
100
102
|
|
103
|
+
<p>Also see the writeups here:
|
104
|
+
<a href="http://axlsx.blogspot.com/">http://axlsx.blogspot.com/</a></p>
|
105
|
+
|
101
106
|
<p>A trivial rails example. In a production environment you will want to you stuff like x_sendfile and Tempfile<br/>
|
102
107
|
<a href="http://www.therailsway.com/2009/2/22/file-downloads-done-right">http://www.therailsway.com/2009/2/22/file-downloads-done-right</a></p>
|
103
108
|
|
@@ -105,22 +110,22 @@
|
|
105
110
|
<a href="http://andrewtimberlake.com/blog/how-to-protect-downloads-but-still-have-nginx-serve-the-files">http://andrewtimberlake.com/blog/how-to-protect-downloads-but-still-have-nginx-serve-the-files</a></p>
|
106
111
|
|
107
112
|
<pre class="code"> <span class='comment val'>#Add the gem to your Gemfile and bundle install</span>
|
108
|
-
<span class='
|
113
|
+
<span class='rubyid_gem identifier id'>gem</span> <span class='string val'>'acts_as_xlsx'</span>
|
109
114
|
|
110
115
|
<span class='comment val'># app/models/post.rb</span>
|
111
|
-
<span class='
|
112
|
-
<span class='
|
113
|
-
<span class='
|
116
|
+
<span class='rubyid_class class kw'>class</span> <span class='rubyid_Post constant id'>Post</span> <span class='lt op'><</span> <span class='rubyid_ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='rubyid_Base constant id'>Base</span>
|
117
|
+
<span class='rubyid_acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
118
|
+
<span class='rubyid_end end kw'>end</span>
|
114
119
|
|
115
120
|
<span class='comment val'># app/controllers/posts_controller.rb</span>
|
116
|
-
<span class='
|
121
|
+
<span class='rubyid_class class kw'>class</span> <span class='rubyid_PostsController constant id'>PostsController</span> <span class='lt op'><</span> <span class='rubyid_ApplicationController constant id'>ApplicationController</span>
|
117
122
|
<span class='comment val'># GET posts/xlsx </span>
|
118
|
-
<span class='
|
119
|
-
<span class='
|
120
|
-
<span class='
|
121
|
-
<span class='
|
122
|
-
<span class='
|
123
|
-
<span class='
|
123
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xlsx identifier id'>xlsx</span>
|
124
|
+
<span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Post constant id'>Post</span><span class='dot token'>.</span><span class='rubyid_to_xlsx identifier id'>to_xlsx</span>
|
125
|
+
<span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
126
|
+
<span class='rubyid_send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
127
|
+
<span class='rubyid_end end kw'>end</span>
|
128
|
+
<span class='rubyid_end end kw'>end</span>
|
124
129
|
|
125
130
|
<span class='comment val'># dont forget to add posts/xslx to your routes!</span>
|
126
131
|
</pre>
|
@@ -128,34 +133,34 @@
|
|
128
133
|
<p>In addition to dumping the entire table, it is also possible to specify the columns and method chains to execute in genrating your report.</p>
|
129
134
|
|
130
135
|
<pre class="code"> <span class='comment val'># GET posts/xslx</span>
|
131
|
-
<span class='
|
132
|
-
<span class='
|
133
|
-
<span class='
|
134
|
-
<span class='
|
135
|
-
<span class='
|
136
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xlsx identifier id'>xlsx</span>
|
137
|
+
<span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Post constant id'>Post</span><span class='dot token'>.</span><span class='rubyid_to_xlsx identifier id'>to_xlsx</span> <span class='symbol val'>:columns</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:title</span><span class='comma token'>,</span> <span class='symbol val'>:ranking</span><span class='comma token'>,</span> <span class='symbol val'>:'comments.last.content'</span><span class='comma token'>,</span> <span class='symbol val'>:'comments.last.author.name'</span><span class='rbrack token'>]</span>
|
138
|
+
<span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
139
|
+
<span class='rubyid_send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
140
|
+
<span class='rubyid_end end kw'>end</span>
|
136
141
|
</pre>
|
137
142
|
|
138
143
|
<p>If your application uses i18n, you can specify the prefix for column labels as well</p>
|
139
144
|
|
140
145
|
<pre class="code"> <span class='comment val'># GET posts/xslx</span>
|
141
|
-
<span class='
|
142
|
-
<span class='
|
143
|
-
<span class='
|
144
|
-
<span class='
|
145
|
-
<span class='
|
146
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xlsx identifier id'>xlsx</span>
|
147
|
+
<span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Post constant id'>Post</span><span class='dot token'>.</span><span class='rubyid_to_xlsx identifier id'>to_xlsx</span> <span class='symbol val'>:i18n</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>'activerecord.attributes'</span>
|
148
|
+
<span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
149
|
+
<span class='rubyid_send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
150
|
+
<span class='rubyid_end end kw'>end</span>
|
146
151
|
</pre>
|
147
152
|
|
148
153
|
<p>For examples on how to use axlsx for custom styles, charts, images and more see:</p>
|
149
154
|
|
150
|
-
<pre class="code"> <span class='lbrack token'>[</span><span class='
|
155
|
+
<pre class="code"> <span class='lbrack token'>[</span><span class='rubyid_http identifier id'>http</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='rubyid_gems identifier id'>gems</span><span class='div op'>/</span><span class='rubyid_axlsx identifier id'>axlsx</span><span class='rbrack token'>]</span> <span class='lparen token'>(</span><span class='rubyid_https identifier id'>https</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='rubyid_gems identifier id'>gems</span><span class='div op'>/</span><span class='rubyid_axlsx identifier id'>axlsx</span><span class='rparen token'>)</span>
|
151
156
|
</pre>
|
152
157
|
|
153
158
|
<h3>Documentation</h3>
|
154
159
|
|
155
160
|
<p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p>
|
156
161
|
|
157
|
-
<pre class="code"> <span class='
|
158
|
-
<span class='
|
162
|
+
<pre class="code"> <span class='rubyid_gem identifier id'>gem</span> <span class='rubyid_install identifier id'>install</span> <span class='rubyid_yard identifier id'>yard</span>
|
163
|
+
<span class='rubyid_yard identifier id'>yard</span> <span class='rubyid_server identifier id'>server</span> <span class='minus op'>-</span><span class='rubyid_g identifier id'>g</span>
|
159
164
|
</pre>
|
160
165
|
|
161
166
|
<h3>Specs</h3>
|
@@ -165,6 +170,12 @@
|
|
165
170
|
<h2>Changelog</h2>
|
166
171
|
|
167
172
|
<ul>
|
173
|
+
<li><p><strong>December.6.11</strong>: 1.0.3 release</p>
|
174
|
+
|
175
|
+
<ul>
|
176
|
+
<li>Added Mime type definition for rails to support respond_to |format| style handling in controllers.</li>
|
177
|
+
</ul>
|
178
|
+
</li>
|
168
179
|
<li><p><strong>December.3.11</strong>: 1.0.2 release
|
169
180
|
Added support for chained method columns like :'model.association.attribute'</p></li>
|
170
181
|
<li><p><strong>October.30.11</strong>: 1.0.1 release</p>
|
@@ -197,9 +208,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title
|
|
197
208
|
</div></div>
|
198
209
|
|
199
210
|
<div id="footer">
|
200
|
-
Generated on
|
211
|
+
Generated on Tue Dec 6 18:49:18 2011 by
|
201
212
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
202
|
-
0.7.
|
213
|
+
0.7.4 (ruby-1.8.7).
|
203
214
|
</div>
|
204
215
|
|
205
216
|
</body>
|
data/doc/file_list.html
CHANGED
data/doc/frames.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
|
-
<title>
|
7
|
+
<title>acts_as_xlsx: a rails plug in for axlsx</title>
|
8
8
|
</head>
|
9
9
|
<frameset cols="20%,*">
|
10
10
|
<frame name="list" src="class_list.html" />
|
data/doc/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
—
|
9
|
+
— acts_as_xlsx: a rails plug in for axlsx
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -63,9 +63,9 @@
|
|
63
63
|
<strong>Author</strong>: Randy Morgan <br/>
|
64
64
|
<strong>Copyright</strong>: 2011 <br/>
|
65
65
|
<strong>License</strong>: MIT License <br/>
|
66
|
-
<strong>Latest Version</strong>: 1.0.
|
66
|
+
<strong>Latest Version</strong>: 1.0.3 <br/>
|
67
67
|
<strong>Ruby Version</strong>: 1.8.7 - 1.9.3<br/>
|
68
|
-
<strong>Release Date</strong>: December
|
68
|
+
<strong>Release Date</strong>: December 6th 2011</p>
|
69
69
|
|
70
70
|
<h2>Synopsis</h2>
|
71
71
|
|
@@ -73,7 +73,7 @@
|
|
73
73
|
|
74
74
|
<h2>Feature List</h2>
|
75
75
|
|
76
|
-
<p>**1. Mixes into active record base to provide to_xlsx
|
76
|
+
<p>**1. Mixes into active record base to provide to_xlsx</p>
|
77
77
|
|
78
78
|
<p>**2. Can work at the end of any series of finder methods.</p>
|
79
79
|
|
@@ -81,23 +81,28 @@
|
|
81
81
|
|
82
82
|
<p>**4. Automates localization of column heading with i18n support</p>
|
83
83
|
|
84
|
-
<p>**5. Lets you specify columns
|
84
|
+
<p>**5. Lets you specify columns and methods chains you want to call to populate your table in one go.</p>
|
85
85
|
|
86
86
|
<p>**6. Gives you access to the axlsx package so you can add styles, charts and pictures to satisfy those flashy sales guys.</p>
|
87
87
|
|
88
88
|
<p>**7. Plays nicely with both ruby 1.8.7 + rails 2.3 as well as ruby 1.9.3 + rails 3</p>
|
89
89
|
|
90
|
+
<p>**8. Automatically registers xlsx Mime type for use in respond_to web-service support.</p>
|
91
|
+
|
90
92
|
<h2>Installing</h2>
|
91
93
|
|
92
94
|
<p>To install, use the following command:</p>
|
93
95
|
|
94
|
-
<pre class="code">$ <span class='
|
96
|
+
<pre class="code">$ <span class='rubyid_gem identifier id'>gem</span> <span class='rubyid_install identifier id'>install</span> <span class='rubyid_acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
95
97
|
</pre>
|
96
98
|
|
97
99
|
<h2>Usage</h2>
|
98
100
|
|
99
101
|
<h3>Examples</h3>
|
100
102
|
|
103
|
+
<p>Also see the writeups here:
|
104
|
+
<a href="http://axlsx.blogspot.com/">http://axlsx.blogspot.com/</a></p>
|
105
|
+
|
101
106
|
<p>A trivial rails example. In a production environment you will want to you stuff like x_sendfile and Tempfile<br/>
|
102
107
|
<a href="http://www.therailsway.com/2009/2/22/file-downloads-done-right">http://www.therailsway.com/2009/2/22/file-downloads-done-right</a></p>
|
103
108
|
|
@@ -105,22 +110,22 @@
|
|
105
110
|
<a href="http://andrewtimberlake.com/blog/how-to-protect-downloads-but-still-have-nginx-serve-the-files">http://andrewtimberlake.com/blog/how-to-protect-downloads-but-still-have-nginx-serve-the-files</a></p>
|
106
111
|
|
107
112
|
<pre class="code"> <span class='comment val'>#Add the gem to your Gemfile and bundle install</span>
|
108
|
-
<span class='
|
113
|
+
<span class='rubyid_gem identifier id'>gem</span> <span class='string val'>'acts_as_xlsx'</span>
|
109
114
|
|
110
115
|
<span class='comment val'># app/models/post.rb</span>
|
111
|
-
<span class='
|
112
|
-
<span class='
|
113
|
-
<span class='
|
116
|
+
<span class='rubyid_class class kw'>class</span> <span class='rubyid_Post constant id'>Post</span> <span class='lt op'><</span> <span class='rubyid_ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='rubyid_Base constant id'>Base</span>
|
117
|
+
<span class='rubyid_acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
118
|
+
<span class='rubyid_end end kw'>end</span>
|
114
119
|
|
115
120
|
<span class='comment val'># app/controllers/posts_controller.rb</span>
|
116
|
-
<span class='
|
121
|
+
<span class='rubyid_class class kw'>class</span> <span class='rubyid_PostsController constant id'>PostsController</span> <span class='lt op'><</span> <span class='rubyid_ApplicationController constant id'>ApplicationController</span>
|
117
122
|
<span class='comment val'># GET posts/xlsx </span>
|
118
|
-
<span class='
|
119
|
-
<span class='
|
120
|
-
<span class='
|
121
|
-
<span class='
|
122
|
-
<span class='
|
123
|
-
<span class='
|
123
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xlsx identifier id'>xlsx</span>
|
124
|
+
<span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Post constant id'>Post</span><span class='dot token'>.</span><span class='rubyid_to_xlsx identifier id'>to_xlsx</span>
|
125
|
+
<span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
126
|
+
<span class='rubyid_send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
127
|
+
<span class='rubyid_end end kw'>end</span>
|
128
|
+
<span class='rubyid_end end kw'>end</span>
|
124
129
|
|
125
130
|
<span class='comment val'># dont forget to add posts/xslx to your routes!</span>
|
126
131
|
</pre>
|
@@ -128,34 +133,34 @@
|
|
128
133
|
<p>In addition to dumping the entire table, it is also possible to specify the columns and method chains to execute in genrating your report.</p>
|
129
134
|
|
130
135
|
<pre class="code"> <span class='comment val'># GET posts/xslx</span>
|
131
|
-
<span class='
|
132
|
-
<span class='
|
133
|
-
<span class='
|
134
|
-
<span class='
|
135
|
-
<span class='
|
136
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xlsx identifier id'>xlsx</span>
|
137
|
+
<span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Post constant id'>Post</span><span class='dot token'>.</span><span class='rubyid_to_xlsx identifier id'>to_xlsx</span> <span class='symbol val'>:columns</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:title</span><span class='comma token'>,</span> <span class='symbol val'>:ranking</span><span class='comma token'>,</span> <span class='symbol val'>:'comments.last.content'</span><span class='comma token'>,</span> <span class='symbol val'>:'comments.last.author.name'</span><span class='rbrack token'>]</span>
|
138
|
+
<span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
139
|
+
<span class='rubyid_send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
140
|
+
<span class='rubyid_end end kw'>end</span>
|
136
141
|
</pre>
|
137
142
|
|
138
143
|
<p>If your application uses i18n, you can specify the prefix for column labels as well</p>
|
139
144
|
|
140
145
|
<pre class="code"> <span class='comment val'># GET posts/xslx</span>
|
141
|
-
<span class='
|
142
|
-
<span class='
|
143
|
-
<span class='
|
144
|
-
<span class='
|
145
|
-
<span class='
|
146
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xlsx identifier id'>xlsx</span>
|
147
|
+
<span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Post constant id'>Post</span><span class='dot token'>.</span><span class='rubyid_to_xlsx identifier id'>to_xlsx</span> <span class='symbol val'>:i18n</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>'activerecord.attributes'</span>
|
148
|
+
<span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
149
|
+
<span class='rubyid_send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
150
|
+
<span class='rubyid_end end kw'>end</span>
|
146
151
|
</pre>
|
147
152
|
|
148
153
|
<p>For examples on how to use axlsx for custom styles, charts, images and more see:</p>
|
149
154
|
|
150
|
-
<pre class="code"> <span class='lbrack token'>[</span><span class='
|
155
|
+
<pre class="code"> <span class='lbrack token'>[</span><span class='rubyid_http identifier id'>http</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='rubyid_gems identifier id'>gems</span><span class='div op'>/</span><span class='rubyid_axlsx identifier id'>axlsx</span><span class='rbrack token'>]</span> <span class='lparen token'>(</span><span class='rubyid_https identifier id'>https</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='rubyid_gems identifier id'>gems</span><span class='div op'>/</span><span class='rubyid_axlsx identifier id'>axlsx</span><span class='rparen token'>)</span>
|
151
156
|
</pre>
|
152
157
|
|
153
158
|
<h3>Documentation</h3>
|
154
159
|
|
155
160
|
<p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p>
|
156
161
|
|
157
|
-
<pre class="code"> <span class='
|
158
|
-
<span class='
|
162
|
+
<pre class="code"> <span class='rubyid_gem identifier id'>gem</span> <span class='rubyid_install identifier id'>install</span> <span class='rubyid_yard identifier id'>yard</span>
|
163
|
+
<span class='rubyid_yard identifier id'>yard</span> <span class='rubyid_server identifier id'>server</span> <span class='minus op'>-</span><span class='rubyid_g identifier id'>g</span>
|
159
164
|
</pre>
|
160
165
|
|
161
166
|
<h3>Specs</h3>
|
@@ -165,6 +170,12 @@
|
|
165
170
|
<h2>Changelog</h2>
|
166
171
|
|
167
172
|
<ul>
|
173
|
+
<li><p><strong>December.6.11</strong>: 1.0.3 release</p>
|
174
|
+
|
175
|
+
<ul>
|
176
|
+
<li>Added Mime type definition for rails to support respond_to |format| style handling in controllers.</li>
|
177
|
+
</ul>
|
178
|
+
</li>
|
168
179
|
<li><p><strong>December.3.11</strong>: 1.0.2 release
|
169
180
|
Added support for chained method columns like :'model.association.attribute'</p></li>
|
170
181
|
<li><p><strong>October.30.11</strong>: 1.0.1 release</p>
|
@@ -197,9 +208,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title
|
|
197
208
|
</div></div>
|
198
209
|
|
199
210
|
<div id="footer">
|
200
|
-
Generated on
|
211
|
+
Generated on Tue Dec 6 18:49:18 2011 by
|
201
212
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
202
|
-
0.7.
|
213
|
+
0.7.4 (ruby-1.8.7).
|
203
214
|
</div>
|
204
215
|
|
205
216
|
</body>
|
data/doc/js/app.js
CHANGED
@@ -2,11 +2,11 @@ function createSourceLinks() {
|
|
2
2
|
$('.method_details_list .source_code').
|
3
3
|
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
4
4
|
$('.toggleSource').toggle(function() {
|
5
|
-
$(this).parent().
|
5
|
+
$(this).parent().nextAll('.source_code').slideDown(100);
|
6
6
|
$(this).text("Hide source");
|
7
7
|
},
|
8
8
|
function() {
|
9
|
-
$(this).parent().
|
9
|
+
$(this).parent().nextAll('.source_code').slideUp(100);
|
10
10
|
$(this).text("View source");
|
11
11
|
});
|
12
12
|
}
|
@@ -109,10 +109,10 @@ function summaryToggle() {
|
|
109
109
|
$('.summary_toggle').click(function() {
|
110
110
|
localStorage.summaryCollapsed = $(this).text();
|
111
111
|
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
112
|
-
var next = $(this).parent().parent().
|
112
|
+
var next = $(this).parent().parent().nextAll('ul.summary').first();
|
113
113
|
if (next.hasClass('compact')) {
|
114
114
|
next.toggle();
|
115
|
-
next.
|
115
|
+
next.nextAll('ul.summary').first().toggle();
|
116
116
|
}
|
117
117
|
else if (next.hasClass('summary')) {
|
118
118
|
var list = $('<ul class="summary compact" />');
|