mack-data_mapper 0.6.0 → 0.6.0.1
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/doc/classes/DataMapper/Resource.html +154 -0
- data/doc/classes/Mack.html +127 -0
- data/doc/classes/Mack/Database.html +210 -0
- data/doc/classes/Mack/Genosaurus/DataMapper/Helpers.html +225 -0
- data/doc/classes/Mack/Genosaurus/DataMapper/ModelColumn.html +237 -0
- data/doc/classes/Mack/Testing/DataMapperHelpers.html +151 -0
- data/doc/classes/Mack/Testing/Helpers.html +155 -0
- data/doc/classes/Mack/ViewHelpers/DataMapperHelpers.html +279 -0
- data/doc/classes/MigrationGenerator.html +161 -0
- data/doc/classes/ModelGenerator.html +183 -0
- data/doc/classes/ScaffoldGenerator.html +123 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +121 -0
- data/doc/files/lib/database_rb.html +101 -0
- data/doc/files/lib/dm_patches/confirmation_validation_rb.html +101 -0
- data/doc/files/lib/dm_patches/dm-cli_rb.html +108 -0
- data/doc/files/lib/dm_patches/migrations_rb.html +101 -0
- data/doc/files/lib/dm_patches/pooling_rb.html +109 -0
- data/doc/files/lib/genosaurus_helpers_rb.html +101 -0
- data/doc/files/lib/helpers/orm_helpers_rb.html +101 -0
- data/doc/files/lib/mack-data_mapper_rb.html +110 -0
- data/doc/files/lib/mack-data_mapper_tasks_rb.html +101 -0
- data/doc/files/lib/migration_generator/migration_generator_rb.html +151 -0
- data/doc/files/lib/model_column_rb.html +101 -0
- data/doc/files/lib/model_generator/model_generator_rb.html +173 -0
- data/doc/files/lib/resource_rb.html +101 -0
- data/doc/files/lib/runner_rb.html +101 -0
- data/doc/files/lib/scaffold_generator/scaffold_generator_rb.html +114 -0
- data/doc/files/lib/test_extensions_rb.html +109 -0
- data/doc/fr_class_index.html +37 -0
- data/doc/fr_file_index.html +43 -0
- data/doc/fr_method_index.html +42 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- metadata +38 -3
@@ -0,0 +1,225 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Mack::Genosaurus::DataMapper::Helpers</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Genosaurus::DataMapper::Helpers</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/genosaurus_helpers_rb.html">
|
59
|
+
lib/genosaurus_helpers.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000006">columns</a>
|
84
|
+
<a href="#M000007">db_directory</a>
|
85
|
+
<a href="#M000008">migrations_directory</a>
|
86
|
+
<a href="#M000009">next_migration_number</a>
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
<!-- if includes -->
|
94
|
+
|
95
|
+
<div id="section">
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if method_list -->
|
105
|
+
<div id="methods">
|
106
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
107
|
+
|
108
|
+
<div id="method-M000006" class="method-detail">
|
109
|
+
<a name="M000006"></a>
|
110
|
+
|
111
|
+
<div class="method-heading">
|
112
|
+
<a href="#M000006" class="method-signature">
|
113
|
+
<span class="method-name">columns</span><span class="method-args">(name = param(:name))</span>
|
114
|
+
</a>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div class="method-description">
|
118
|
+
<p><a class="source-toggle" href="#"
|
119
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
120
|
+
<div class="method-source-code" id="M000006-source">
|
121
|
+
<pre>
|
122
|
+
<span class="ruby-comment cmt"># File lib/genosaurus_helpers.rb, line 6</span>
|
123
|
+
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">columns</span>(<span class="ruby-identifier">name</span> = <span class="ruby-identifier">param</span>(<span class="ruby-identifier">:name</span>))
|
124
|
+
7: <span class="ruby-identifier">ivar_cache</span>(<span class="ruby-value str">"form_columns"</span>) <span class="ruby-keyword kw">do</span>
|
125
|
+
8: <span class="ruby-identifier">cs</span> = []
|
126
|
+
9: <span class="ruby-identifier">cols</span> = (<span class="ruby-identifier">param</span>(<span class="ruby-identifier">:cols</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">param</span>(<span class="ruby-identifier">:columns</span>))
|
127
|
+
10: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cols</span>
|
128
|
+
11: <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">","</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
|
129
|
+
12: <span class="ruby-identifier">cs</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Genosaurus</span><span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">ModelColumn</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">x</span>)
|
130
|
+
13: <span class="ruby-keyword kw">end</span>
|
131
|
+
14: <span class="ruby-keyword kw">end</span>
|
132
|
+
15: <span class="ruby-identifier">cs</span>
|
133
|
+
16: <span class="ruby-keyword kw">end</span>
|
134
|
+
17: <span class="ruby-keyword kw">end</span>
|
135
|
+
</pre>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div id="method-M000007" class="method-detail">
|
141
|
+
<a name="M000007"></a>
|
142
|
+
|
143
|
+
<div class="method-heading">
|
144
|
+
<a href="#M000007" class="method-signature">
|
145
|
+
<span class="method-name">db_directory</span><span class="method-args">()</span>
|
146
|
+
</a>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
<p><a class="source-toggle" href="#"
|
151
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
152
|
+
<div class="method-source-code" id="M000007-source">
|
153
|
+
<pre>
|
154
|
+
<span class="ruby-comment cmt"># File lib/genosaurus_helpers.rb, line 19</span>
|
155
|
+
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">db_directory</span>
|
156
|
+
20: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Mack</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">"db"</span>)
|
157
|
+
21: <span class="ruby-keyword kw">end</span>
|
158
|
+
</pre>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div id="method-M000008" class="method-detail">
|
164
|
+
<a name="M000008"></a>
|
165
|
+
|
166
|
+
<div class="method-heading">
|
167
|
+
<a href="#M000008" class="method-signature">
|
168
|
+
<span class="method-name">migrations_directory</span><span class="method-args">()</span>
|
169
|
+
</a>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<div class="method-description">
|
173
|
+
<p><a class="source-toggle" href="#"
|
174
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
175
|
+
<div class="method-source-code" id="M000008-source">
|
176
|
+
<pre>
|
177
|
+
<span class="ruby-comment cmt"># File lib/genosaurus_helpers.rb, line 23</span>
|
178
|
+
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">migrations_directory</span>
|
179
|
+
24: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">db_directory</span>, <span class="ruby-value str">"migrations"</span>)
|
180
|
+
25: <span class="ruby-keyword kw">end</span>
|
181
|
+
</pre>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
<div id="method-M000009" class="method-detail">
|
187
|
+
<a name="M000009"></a>
|
188
|
+
|
189
|
+
<div class="method-heading">
|
190
|
+
<a href="#M000009" class="method-signature">
|
191
|
+
<span class="method-name">next_migration_number</span><span class="method-args">()</span>
|
192
|
+
</a>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="method-description">
|
196
|
+
<p><a class="source-toggle" href="#"
|
197
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
198
|
+
<div class="method-source-code" id="M000009-source">
|
199
|
+
<pre>
|
200
|
+
<span class="ruby-comment cmt"># File lib/genosaurus_helpers.rb, line 27</span>
|
201
|
+
27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_migration_number</span>
|
202
|
+
28: <span class="ruby-identifier">last</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">migrations_directory</span>, <span class="ruby-value str">"*.rb"</span>)).<span class="ruby-identifier">last</span>
|
203
|
+
29: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">last</span>
|
204
|
+
30: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">last</span>).<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^\d+/</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">succ</span>
|
205
|
+
31: <span class="ruby-keyword kw">end</span>
|
206
|
+
32: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">"001"</span>
|
207
|
+
33: <span class="ruby-keyword kw">end</span>
|
208
|
+
</pre>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
|
220
|
+
<div id="validator-badges">
|
221
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
</body>
|
225
|
+
</html>
|
@@ -0,0 +1,237 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Mack::Genosaurus::DataMapper::ModelColumn</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Genosaurus::DataMapper::ModelColumn</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/model_column_rb.html">
|
59
|
+
lib/model_column.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Used to represent a ‘column’ from the param cols or columns for
|
84
|
+
generators.
|
85
|
+
</p>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div id="method-list">
|
93
|
+
<h3 class="section-bar">Methods</h3>
|
94
|
+
|
95
|
+
<div class="name-list">
|
96
|
+
<a href="#M000011">form_field</a>
|
97
|
+
<a href="#M000010">new</a>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if includes -->
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<div id="attribute-list">
|
113
|
+
<h3 class="section-bar">Attributes</h3>
|
114
|
+
|
115
|
+
<div class="name-list">
|
116
|
+
<table>
|
117
|
+
<tr class="top-aligned-row context-row">
|
118
|
+
<td class="context-item-name">column_name</td>
|
119
|
+
<td class="context-item-value"> [RW] </td>
|
120
|
+
<td class="context-item-desc">
|
121
|
+
The name of the column.
|
122
|
+
|
123
|
+
</td>
|
124
|
+
</tr>
|
125
|
+
<tr class="top-aligned-row context-row">
|
126
|
+
<td class="context-item-name">column_type</td>
|
127
|
+
<td class="context-item-value"> [RW] </td>
|
128
|
+
<td class="context-item-desc">
|
129
|
+
The type of the column. Ie. string, integer, datetime, etc…
|
130
|
+
|
131
|
+
</td>
|
132
|
+
</tr>
|
133
|
+
<tr class="top-aligned-row context-row">
|
134
|
+
<td class="context-item-name">model_name</td>
|
135
|
+
<td class="context-item-value"> [RW] </td>
|
136
|
+
<td class="context-item-desc">
|
137
|
+
The name of the model associated with the column. Ie. user, post,
|
138
|
+
etc…
|
139
|
+
|
140
|
+
</td>
|
141
|
+
</tr>
|
142
|
+
</table>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<!-- if method_list -->
|
149
|
+
<div id="methods">
|
150
|
+
<h3 class="section-bar">Public Class methods</h3>
|
151
|
+
|
152
|
+
<div id="method-M000010" class="method-detail">
|
153
|
+
<a name="M000010"></a>
|
154
|
+
|
155
|
+
<div class="method-heading">
|
156
|
+
<a href="#M000010" class="method-signature">
|
157
|
+
<span class="method-name">new</span><span class="method-args">(model_name, column_unsplit)</span>
|
158
|
+
</a>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div class="method-description">
|
162
|
+
<p>
|
163
|
+
Takes in the model_name (user, post, etc…) and the column
|
164
|
+
(username:string, body:text, etc…)
|
165
|
+
</p>
|
166
|
+
<p><a class="source-toggle" href="#"
|
167
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000010-source">
|
169
|
+
<pre>
|
170
|
+
<span class="ruby-comment cmt"># File lib/model_column.rb, line 15</span>
|
171
|
+
15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">model_name</span>, <span class="ruby-identifier">column_unsplit</span>)
|
172
|
+
16: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">model_name</span> = <span class="ruby-identifier">model_name</span>.<span class="ruby-identifier">singular</span>.<span class="ruby-identifier">underscore</span>
|
173
|
+
17: <span class="ruby-identifier">cols</span> = <span class="ruby-identifier">column_unsplit</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">":"</span>)
|
174
|
+
18: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">column_name</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">first</span><span class="ruby-comment cmt">#.underscore</span>
|
175
|
+
19: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">column_type</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">last</span><span class="ruby-comment cmt">#.underscore</span>
|
176
|
+
20: <span class="ruby-keyword kw">end</span>
|
177
|
+
</pre>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
183
|
+
|
184
|
+
<div id="method-M000011" class="method-detail">
|
185
|
+
<a name="M000011"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
<a href="#M000011" class="method-signature">
|
189
|
+
<span class="method-name">form_field</span><span class="method-args">()</span>
|
190
|
+
</a>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
<p>
|
195
|
+
Generates the appropriate HTML form field for the type of column
|
196
|
+
represented.
|
197
|
+
</p>
|
198
|
+
<p>
|
199
|
+
Examples:
|
200
|
+
</p>
|
201
|
+
<pre>
|
202
|
+
Mack::Generator::ColumnObject.new("user", "username:string").form_field
|
203
|
+
=> "<%= model_text_field(@user, :username) %>"
|
204
|
+
Mack::Generator::ColumnObject.new("Post", "body:text").form_field
|
205
|
+
=> "<%= model_textarea(@user, :username) %>"
|
206
|
+
</pre>
|
207
|
+
<p><a class="source-toggle" href="#"
|
208
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
209
|
+
<div class="method-source-code" id="M000011-source">
|
210
|
+
<pre>
|
211
|
+
<span class="ruby-comment cmt"># File lib/model_column.rb, line 29</span>
|
212
|
+
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_field</span>
|
213
|
+
30: <span class="ruby-keyword kw">case</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">column_type</span>
|
214
|
+
31: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"text"</span>
|
215
|
+
32: <span class="ruby-node">%{<%= model_textarea(@#{self.model_name}, :#{self.column_name}) %>}</span>
|
216
|
+
33: <span class="ruby-keyword kw">else</span>
|
217
|
+
34: <span class="ruby-node">%{<%= model_text_field(@#{self.model_name}, :#{self.column_name}) %>}</span>
|
218
|
+
35: <span class="ruby-keyword kw">end</span>
|
219
|
+
36: <span class="ruby-keyword kw">end</span>
|
220
|
+
</pre>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
<div id="validator-badges">
|
233
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
</body>
|
237
|
+
</html>
|