masterview 0.1.5 → 0.2.0

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.
Files changed (105) hide show
  1. data/CHANGELOG +17 -0
  2. data/README +36 -504
  3. data/RELEASE_NOTES +126 -45
  4. data/Rakefile +215 -86
  5. data/TODO +8 -3
  6. data/doc/configuration.html +485 -0
  7. data/doc/directives.html +1085 -0
  8. data/doc/guide.html +243 -0
  9. data/doc/index.html +287 -0
  10. data/doc/installation.html +376 -0
  11. data/doc/stylesheets/masterview.css +206 -0
  12. data/doc/stylesheets/mv-config.css +23 -0
  13. data/doc/stylesheets/mv-directives.css +18 -0
  14. data/doc/stylesheets/mv-installation.css +10 -0
  15. data/doc/troubleshooting.html +18 -0
  16. data/examples/product.html +256 -0
  17. data/examples/product.html.old +107 -0
  18. data/examples/rails_app_config/masterview/environment/development.rb +22 -0
  19. data/examples/rails_app_config/masterview/environment/production.rb +9 -0
  20. data/examples/rails_app_config/masterview/settings.rb +59 -0
  21. data/examples/test.import +80 -0
  22. data/init.rb +26 -12
  23. data/lib/masterview/analyzer.rb +25 -15
  24. data/lib/masterview/directive_base.rb +4 -0
  25. data/lib/masterview/directive_helpers.rb +7 -5
  26. data/lib/masterview/directives/import_render.rb +6 -0
  27. data/lib/masterview/directives/insert_generated_comment.rb +8 -8
  28. data/lib/masterview/extras/app/controllers/masterview_controller.rb +154 -2
  29. data/lib/masterview/extras/app/views/masterview/admin/create.rhtml +4 -4
  30. data/lib/masterview/extras/app/views/masterview/admin/empty.rhtml +1 -1
  31. data/lib/masterview/extras/app/views/masterview/admin/list.rhtml +14 -9
  32. data/lib/masterview/extras/app/views/masterview/admin/view_rhtml.rhtml +70 -0
  33. data/lib/masterview/extras/init_logger.rb +102 -0
  34. data/lib/masterview/extras/init_rails_erb_mv_direct.rb +117 -0
  35. data/lib/masterview/extras/init_rails_reparse_checking.rb +59 -0
  36. data/lib/masterview/extras/watcher.rb +17 -23
  37. data/lib/masterview/filter_helpers.rb +26 -0
  38. data/lib/masterview/initializer.rb +912 -0
  39. data/lib/masterview/io.rb +352 -0
  40. data/lib/masterview/keyword_expander.rb +116 -0
  41. data/lib/masterview/masterview_version.rb +2 -2
  42. data/lib/masterview/mtime_tracking_hash.rb +44 -0
  43. data/lib/masterview/parser.rb +64 -92
  44. data/lib/masterview/pathname_extensions.rb +33 -0
  45. data/lib/masterview/template_spec.rb +49 -56
  46. data/lib/masterview.rb +40 -85
  47. data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/environments/development.rb +12 -0
  48. data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/environments/production.rb +11 -0
  49. data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/settings.rb +23 -0
  50. data/test/fixtures/templates/product.html +256 -0
  51. data/test/fixtures/templates/test.import +80 -0
  52. data/test/test_helper.rb +5 -3
  53. data/test/tmp/template/foo.txt +1 -0
  54. data/test/tmp/templates_src/product.html +256 -0
  55. data/test/tmp/views/layouts/product.rhtml +35 -0
  56. data/test/tmp/views/product/_form.rhtml +30 -0
  57. data/test/tmp/views/product/_product.rhtml +14 -0
  58. data/test/tmp/views/product/_show.rhtml +27 -0
  59. data/test/tmp/views/product/destroy.rhtml +27 -0
  60. data/test/tmp/views/product/edit.rhtml +26 -0
  61. data/test/tmp/views/product/list.rhtml +31 -0
  62. data/test/tmp/views/product/new.rhtml +29 -0
  63. data/test/tmp/views/product/show.rhtml +16 -0
  64. data/test/unit/config_settings_test.rb +172 -0
  65. data/test/{attr_test.rb → unit/directive_attr_test.rb} +2 -2
  66. data/test/{block_test.rb → unit/directive_block_test.rb} +2 -2
  67. data/test/{content_test.rb → unit/directive_content_test.rb} +2 -2
  68. data/test/{else_test.rb → unit/directive_else_test.rb} +2 -2
  69. data/test/{elsif_test.rb → unit/directive_elsif_test.rb} +2 -2
  70. data/test/{form_test.rb → unit/directive_form_test.rb} +2 -2
  71. data/test/{global_inline_erb_test.rb → unit/directive_global_inline_erb_test.rb} +2 -2
  72. data/test/{hidden_field_test.rb → unit/directive_hidden_field_test.rb} +2 -2
  73. data/test/{if_test.rb → unit/directive_if_test.rb} +2 -2
  74. data/test/unit/directive_import_render_test.rb +62 -0
  75. data/test/{import_test.rb → unit/directive_import_test.rb} +2 -2
  76. data/test/{javascript_include_test.rb → unit/directive_javascript_include_test.rb} +2 -2
  77. data/test/{link_to_if_test.rb → unit/directive_link_to_if_test.rb} +2 -2
  78. data/test/{link_to_test.rb → unit/directive_link_to_test.rb} +2 -2
  79. data/test/{omit_tag_test.rb → unit/directive_omit_tag_test.rb} +2 -2
  80. data/test/{password_field_test.rb → unit/directive_password_field_test.rb} +2 -2
  81. data/test/{replace_test.rb → unit/directive_replace_test.rb} +2 -2
  82. data/test/{stylesheet_link_test.rb → unit/directive_stylesheet_link_test.rb} +2 -2
  83. data/test/{submit_test.rb → unit/directive_submit_test.rb} +2 -2
  84. data/test/{text_area_test.rb → unit/directive_text_area_test.rb} +2 -2
  85. data/test/{text_field_test.rb → unit/directive_text_field_test.rb} +2 -2
  86. data/test/{example_test.rb → unit/example_test.rb} +1 -1
  87. data/test/unit/file_mio_test.rb +368 -0
  88. data/test/{filter_helpers_test.rb → unit/filter_helpers_test.rb} +1 -1
  89. data/test/unit/keyword_expander_test.rb +95 -0
  90. data/test/unit/mio_test.rb +110 -0
  91. data/test/unit/mtime_string_hash_mio_tree_test.rb +289 -0
  92. data/test/unit/mtime_tracking_hash_test.rb +38 -0
  93. data/test/{parser_test.rb → unit/parser_test.rb} +19 -1
  94. data/test/unit/pathname_extensions_test.rb +46 -0
  95. data/test/{run_parser_test.rb → unit/run_parser_test.rb} +7 -3
  96. data/test/unit/string_hash_mio_test.rb +320 -0
  97. data/test/unit/template_file_watcher_test.rb +107 -0
  98. data/test/{template_spec_test.rb → unit/template_spec_test.rb} +57 -21
  99. data/test/{template_test.rb → unit/template_test.rb} +123 -22
  100. data/test/xtras/config-mv-logger_config.rb +109 -0
  101. data/test/xtras/config_initialize_standalone.rb +53 -0
  102. metadata +111 -38
  103. data/lib/masterview/extras/rails_init.rb +0 -72
  104. data/test/import_render_test.rb +0 -30
  105. data/test/template_file_watcher_test.rb +0 -50
@@ -0,0 +1,1085 @@
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
+
9
+ <title>MasterView - Directives Reference</title>
10
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
11
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
12
+
13
+ <link href="./stylesheets/masterview.css" rel="stylesheet" type="text/css" />
14
+ <link href="./stylesheets/mv-directives.css" rel="stylesheet" type="text/css" />
15
+ </head>
16
+
17
+ <body>
18
+
19
+ <div id="pageHeader">
20
+ <div>MasterView Template Engine</div>
21
+ <div class="description">Rails-optimized (x)html friendly template engine</div>
22
+ </div>
23
+
24
+ <div id="pageBody">
25
+ <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
26
+
27
+ <h1>MasterView - Directives Reference</h1>
28
+
29
+ <p>MasterView template processing directives are encoded in an (x)html template
30
+ using attribute markup. A MasterView directive is an element attribute
31
+ in the <span class="directiveName">mv:</span> namespace.
32
+ By convention, Masterview directive attribute names use lower-case letters with
33
+ underscore as a separator, e.g., <span class="directiveName">mv:generate</span>, <span class="directiveName">mv:link_to</span>.
34
+ </p>
35
+
36
+ <p class="explanation">
37
+ <b>Note:</b> use of the <span class="directiveName">mv:</span> namespace
38
+ used for MasterView directives in an (x)html template can be modified
39
+ by a configuration setting. See the <a href="configuration.html">MasterView Configuration Guide</a> for details. However, we recommend that you do not change this namespace convention unless truly necessary - it's easier to understand your templates when they follow the standard markup convention.
40
+ </p>
41
+
42
+ <p>MasterView provides a number of built-in directives for general use.
43
+ You can also create your own custom directives to extend the power of the
44
+ MasterView template processing with markup notation and processing directives
45
+ that support standard uses for your particular application.
46
+ <!--TODO: add link the Directive Developer's Guide-->
47
+ </p>
48
+
49
+ <h3>Keyword Substitution in Directives</h3>
50
+ <p>
51
+ MasterView supports several standard keywords derived from information about the template
52
+ file being processed that can be used in attribute values for the
53
+ <span class="directiveName">mv:generate</span> and
54
+ <span class="directiveName">mv:gen_partial</span> directives.
55
+ </p>
56
+ <pre class="code">
57
+ {template_path} == use original masterview template path with default output extension (one/foo/bar.rhtml)
58
+ {template_path}.ext == use original masterview template path with the specified extension (one/foo/bar.ext)
59
+ {template_dir_path} == direct_parent_dirname (one/foo)
60
+ {template_basename} == base filename (bar)
61
+ {extension} == filename extension (.html)
62
+ </pre>
63
+
64
+ <p>A typical use would be to specify the generated output for the main content
65
+ of a template <code>one/two/foo.html</code> with the directive
66
+ <code>mv:generate="{template_path}"</code>.
67
+ This keyword notation avoids the need to replicate the template's own file name or
68
+ it's relative path within the Rails <code>app/views</code> directory in the
69
+ directive markup in the template.
70
+ </p>
71
+
72
+
73
+ <h2>Directives Summary</h2>
74
+ <table class="toc" summary="summary of directives, grouped by functional area">
75
+ <tbody>
76
+ <tr class="subheader">
77
+ <td colspan="2"><a href="#processing_directives">Template Processing Directives</a></td>
78
+ </tr>
79
+ <tr>
80
+ <td class="directive"><a href="#mv_generate">mv:generate</a></td>
81
+ <td>Generate output containing this element and its children</td>
82
+ </tr>
83
+ <tr>
84
+ <td class="directive"><a href="#mv_import">mv:import</a></td>
85
+ <td>Design-time directive to mark a snapshot of generated code</td>
86
+ </tr>
87
+ <tr>
88
+ <td class="directive"><a href="#mv_gen_partial">mv:gen_partial</a></td>
89
+ <td>Generate a Rails partial</td>
90
+ </tr>
91
+ <tr>
92
+ <td class="directive"><a href="#mv_import_render">mv:import_render</a></td>
93
+ <td>Design-time directive to mark a snapshot of generated partial code</td>
94
+ </tr>
95
+ <tr>
96
+ <td class="directive"><a href="#mv_gen_replace">mv:gen_replace</a></td>
97
+ <td>Used with <span class="directiveName">mv:generate</span> to replace the content of this element in the generated output with the value of the attribute</td>
98
+ </tr>
99
+
100
+ <tr class="subheader">
101
+ <td colspan="2"><a href="#general_directives">General Processing Directives</a></td>
102
+ </tr>
103
+ <tr>
104
+ <td class="directive"><a href="#mv_attr">mv:attr</a></td>
105
+ <td>Replaces attribute value(s) on this element with the value of an expression</td>
106
+ </tr>
107
+ <tr>
108
+ <td class="directive"><a href="#mv_content">mv:content</a></td>
109
+ <td>Replaces the content of this element with the value of the expression</td>
110
+ </tr>
111
+ <tr>
112
+ <td class="directive"><a href="#mv_omit_tag">mv:omit_tag</a></td>
113
+ <td>Omits this element from the generated output if the value is empty or evaluates to true</td>
114
+ </tr>
115
+ <tr>
116
+ <td class="directive"><a href="#mv_replace">mv:replace</a></td>
117
+ <td>Replaces this element and its content with the value of the expression</td>
118
+ </tr>
119
+
120
+ <tr class="subheader">
121
+ <td colspan="2"><a href="#erb_control_directives">Erb and Control Flow Directives</a></td>
122
+ </tr>
123
+ <tr>
124
+ <td class="directive"><a href="#mv_block">mv:block</a></td>
125
+ <td>Expands to the equivalent rhtml (erb) block code around this element</td>
126
+ </tr>
127
+ <tr>
128
+ <td class="directive"><a href="#mv_if">mv:if</a></td>
129
+ <td>Wraps this element with an <code>if... end</code> block using the attribute contents for the condition</td>
130
+ </tr>
131
+ <tr>
132
+ <td class="directive"><a href="#mv_elsif">mv:elsif</a></td>
133
+ <td>Used in conjunction with the <span class="directiveName">mv:if</span> directive to allow you to create <code>if... elsif... end</code> blocks</td>
134
+ </tr>
135
+ <tr>
136
+ <td class="directive"><a href="#mv_else">mv:else</a></td>
137
+ <td>Used in conjunction with the <span class="directiveName">mv:if</span> and <span class="directiveName">mv:elsif</span> directives to allow you to create <code>if... elsif... else... end</code> blocks</td>
138
+ </tr>
139
+ <tr>
140
+ <td class="directive"><a href="#mv_inline_erb">Inline Erb substitutions </a></td>
141
+ <td>Inline substitution notation for Erb expressions</td>
142
+ </tr>
143
+
144
+ <tr class="subheader">
145
+ <td colspan="2"><a href="#asset_link_directives">Rails Asset and Link Helper Directives</a></td>
146
+ </tr>
147
+ <tr>
148
+ <td class="directive"><a href="#mv_javascript_include">mv:javascript_include</a></td>
149
+ <td>Replaces this element using the Rails <code>javascript_include_tag</code> helper.
150
+ <span class="explanation">(
151
+ Used on <code>&lt;script&gt;</code> element in html header section
152
+ )</span>
153
+ </td>
154
+ </tr>
155
+ <tr>
156
+ <td class="directive"><a href="#mv_link_to">mv:link_to</a></td>
157
+ <td>Replaces this element using the Rails <code>link_to</code> helper.
158
+ <span class="explanation">(
159
+ Used on <code>&lt;a&gt;</code> link elements
160
+ )</span>
161
+ </td>
162
+ </tr>
163
+ <tr>
164
+ <td class="directive"><a href="#mv_link_to_if">mv:link_to_if</a></td>
165
+ <td>Replaces this element using the Rails <code>link_to_if</code> helper
166
+ <span class="explanation">(
167
+ Used on <code>&lt;a&gt;</code> link elements
168
+ )</span>
169
+ </td>
170
+ </tr>
171
+ <tr>
172
+ <td class="directive"><a href="#mv_link_to_remote">mv:link_to_remote</a></td>
173
+ <td>Replaces this element using the Rails <code>link_to_remote</code> helper
174
+ <span class="explanation">(
175
+ Used on <code>&lt;a&gt;</code> link elements
176
+ )</span>
177
+ </td>
178
+ </tr>
179
+ <tr>
180
+ <td class="directive"><a href="#mv_stylesheet_link">mv:stylesheet_link</a></td>
181
+ <td>Replaces this element using the Rails <code>stylesheet_link_tag</code> helper
182
+ <span class="explanation">(
183
+ Used on stylesheet <code>&lt;link&gt;</code> elements in html header section
184
+ )</span>
185
+ </td>
186
+ </tr>
187
+
188
+ <tr class="subheader">
189
+ <td colspan="2"><a href="#form_directives">Rails Form Helper Directives</a></td>
190
+ </tr>
191
+ <tr>
192
+ <td class="directive"><a href="#mv_form">mv:form</a></td>
193
+ <td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> and <code>form_tag</code> helpers</td>
194
+ </tr>
195
+ <tr>
196
+ <td class="directive"><a href="#mv_hidden_field">mv:hidden_field</a></td>
197
+ <td>Replaces this element with a <code>hidden</code> input element using the Rails <code>hidden_tag</code> helper.
198
+ <span class="explanation">(
199
+ Used on <code>&lt;input&gt;</code> form elements
200
+ )</span>
201
+ </td>
202
+ </tr>
203
+ <tr>
204
+ <td class="directive"><a href="#mv_password_field">mv:password_field</a></td>
205
+ <td>Replaces this element with a <code>password</code> input element using the Rails <code>password_field</code> helper.
206
+ <span class="explanation">(
207
+ Used on <code>&lt;input&gt;</code> form elements
208
+ )</span>
209
+ </td>
210
+ </tr>
211
+ <tr>
212
+ <td class="directive"><a href="#mv_submit">mv:submit</a></td>
213
+ <td>Replaces this element with a <code>submit</code> input element using the Rails <code>submit_tag</code> helper.
214
+ <span class="explanation">(
215
+ Used on <code>&lt;input&gt;</code> form elements
216
+ )</span>
217
+ </td>
218
+ </tr>
219
+
220
+ <tr>
221
+ <td class="directive"><a href="#mv_text_area">mv:text_area</a></td>
222
+ <td>Replaces this element with a <code>textarea</code> input element using the Rails <code>text_area</code> helper.
223
+ <span class="explanation">(
224
+ Used on <code>&lt;textarea&gt;</code> form elements
225
+ )</span>
226
+ </td>
227
+ </tr>
228
+ <tr>
229
+ <td class="directive"><a href="#mv_text_field">mv:text_field</a></td>
230
+ <td>Replaces this element with a <code>text</code> input element using the Rails <code>text_field</code> helper.
231
+ <span class="explanation">(
232
+ Used on <code>&lt;input&gt;</code> form elements
233
+ )</span>
234
+ </td>
235
+ </tr>
236
+
237
+ <!--
238
+ <tr>
239
+ <td class="directive"><a href="#mv_NAME">mv:NAME</a></td>
240
+ <td>DESCR</td>
241
+ </tr>
242
+ -->
243
+ </tbody>
244
+ </table>
245
+
246
+ <p class="explanation"><a href="#directives_index">Directives Index</a> (alphabetical)</p>
247
+
248
+ <hr />
249
+ <h2>Directives Reference</h2>
250
+
251
+ <a name="processing_directives"></a>
252
+ <h3>Template Processing Directives</h3>
253
+ <a name="mv_generate"></a>
254
+ <h4>mv:generate</h4>
255
+ <p>
256
+ mv:generate=&quot;layouts/product.rhtml&quot;
257
+ </p>
258
+ <pre>
259
+ When the generate directive is encountered it creates a new output rhtml file where this element and its
260
+ children will be rendered. It also will suspend outputting to any previous output file until it is done with this
261
+ one (nested). MasterView will not output any rhtml files unless it encouters one of these or mv:gen_partial directive
262
+ below. Typically you will have one of these in the very top html element to generate the layout, and you will have
263
+ additional directives further inside to output different view partials and forms. MasterView takes this one html
264
+ file and generates all the other layout, forms, and partials that you would do manually. for example...
265
+
266
+ &lt;html mv:generate=&quot;layouts/product.rhtml&quot;&gt;
267
+ &lt;title&gt;Hello&lt;/title&gt;
268
+ &lt;body&gt;
269
+ &lt;div mv:replace=&quot;@content_for_layout&quot;&gt;
270
+ &lt;div mv:generate=&quot;product/new.rhtml&quot;&gt;
271
+ &lt;form&gt;&lt;/form&gt;
272
+ &lt;/div&gt;
273
+ &lt;/div&gt;
274
+ &lt;/body&gt;
275
+ &lt;/html&gt;
276
+
277
+ outputs to two files
278
+
279
+ app/views/layouts/product.rhtml
280
+ &lt;html&gt;
281
+ &lt;title&gt;Hello&lt;/title&gt;
282
+ &lt;body&gt;
283
+ &lt;%= @content_for_layout %&gt;
284
+ &lt;/body&gt;
285
+ &lt;/html&gt;
286
+
287
+ app/views/product/new.rhtml
288
+ &lt;div&gt;
289
+ &lt;form&gt;&lt;/form&gt;
290
+ &lt;/div&gt;
291
+ </pre>
292
+
293
+ <a name="mv_import"></a>
294
+ <h4>mv:import</h4>
295
+ <p>
296
+ mv:import=&quot;layouts/product.rhtml&quot;
297
+ </p>
298
+ <pre>
299
+ When the import directive is used, it is a mirror image of the generate directive, except that this directive
300
+ doesn't generate any output, it is only used for design time editing. The code inside this tag represents a point
301
+ in time capture of the real generated code and if it ever gets out of sync it can easily be sync'd back up by
302
+ visiting the MasterView admin page or using rake mv:rebuild_all
303
+ </pre>
304
+
305
+ <a name="mv_gen_partial"></a>
306
+ <h4>mv:gen_partial</h4>
307
+ <p>
308
+ mv:gen_partial=&quot;:partial =&gt; &#8216;product/form&#8217;&quot;
309
+ </p>
310
+ <pre>
311
+ This directive does two things it creates a partial and it outputs the appropriate code to render this
312
+ partial in the parent output file before beginning output of the partial. It calculates the file name from the
313
+ :partial value and appends .rhtml for example...
314
+
315
+ &lt;html mv:generate=&quot;layouts/product.rhtml&quot;&gt;
316
+ &lt;body&gt;
317
+ &lt;div mv:gen_partial=&quot;:partial =&gt; 'product/show'&quot;&gt;
318
+ Name: &lt;span class=&quot;static&quot; mv:content=&quot;h @product.send(:name)&quot;&gt;product Name dummy text&lt;/span&gt;
319
+ Description: &lt;span class=&quot;static&quot; mv:content=&quot;h @product.send(:description)&quot;&gt;product description dummy text&lt;/span&gt;
320
+ &lt;/div&gt;
321
+ &lt;/body&gt;
322
+ &lt;/html&gt;
323
+
324
+ outputs two files
325
+
326
+ app/views/layouts/product.rhtml
327
+ &lt;html&gt;
328
+ &lt;body&gt;
329
+ &lt;%= render :partial =&gt; 'product/show' %&gt;
330
+ &lt;/body&gt;
331
+ &lt;/html&gt;
332
+
333
+ app/views/product/_show.rhtml
334
+ &lt;div&gt;
335
+ Name: &lt;span class=&quot;static&quot;&gt;&lt;%= h @product.send(:name) %&gt;&lt;/span&gt;
336
+ Description: &lt;span class=&quot;static&quot;&gt;&lt;%= h @product.send(:description) %&gt;&lt;/span&gt;
337
+ &lt;/div&gt;
338
+
339
+ You can also use collections with your partials like
340
+
341
+ &lt;div mv:gen_partial=&quot;:partial =&gt; 'shared/product', :collection =&gt; @products&quot;&gt;
342
+
343
+ which will create the partial shared/_product.rhtml and will render this partial over a collection
344
+ </pre>
345
+
346
+
347
+ <a name="mv_import_render"></a>
348
+ <h4>mv:import_render</h4>
349
+ <p>
350
+ mv:import_render=&quot;partial =&gt; &#8216;product/form&#8217;&quot;
351
+ </p>
352
+ <pre>
353
+ Similar to how import directive is a mirror to generate, import_render is a mirror to gen_partial. This directive
354
+ generates the appropriate render partial helper, but doesn't generate any additional output, it is only used for
355
+ design time editing and can be easily sync'd up if it ever gets out of sync with the original code.
356
+ </pre>
357
+ <p>
358
+
359
+ <a name="mv_gen_replace"></a>
360
+ <h4>mv:gen_replace</h4>
361
+ <p>
362
+ mv:gen_replace=&quot;whatToLeave&quot;
363
+ </p>
364
+ <pre>
365
+ When used in conjunction with mv:generate directive it causes the value of the attribute to be erb
366
+ executed output in the parent file before transferring to the child (nested) output file. for example...
367
+
368
+ &lt;html mv:generate=&quot;layouts/product.rhtml&quot;&gt;
369
+ &lt;title&gt;Hello&lt;/title&gt;
370
+ &lt;body&gt;
371
+ &lt;div mv:generate=&quot;product/new.rhtml&quot; mv:gen_replace=&quot;@content_for_layout&gt;
372
+ &lt;form&gt;&lt;/form&gt;
373
+ &lt;/div&gt;
374
+ &lt;/body&gt;
375
+ &lt;/html&gt;
376
+
377
+ outputs two files
378
+
379
+ app/views/layouts/product.rhtml
380
+ &lt;html&gt;
381
+ &lt;title&gt;Hello&lt;/title&gt;
382
+ &lt;body&gt;
383
+ &lt;%= @content_for_layout %&gt;
384
+ &lt;/body&gt;
385
+ &lt;/html&gt;
386
+
387
+ app/views/product/new.rhtml
388
+ &lt;div&gt;
389
+ &lt;form&gt;&lt;/form&gt;
390
+ &lt;/div&gt;
391
+ </pre>
392
+
393
+ <a name="general_directives"></a>
394
+ <h3>General Processing Directives</h3>
395
+
396
+ <a name="mv_attr"></a>
397
+ <h4>mv:attr</h4>
398
+ <p>
399
+ mv:attr=&quot;:foo =&gt; &#8216;bar&#8217;, :cat =&gt; #{h
400
+ product.name}&quot;
401
+ </p>
402
+ <pre>
403
+ At runtime this sets attribute values on the element this directive is defined on, for example...
404
+
405
+ &lt;div mv:attr=&quot;:foo =&gt; 'bar', :hi =&gt; 'cat'&quot;&gt;hello&lt;/div&gt;
406
+
407
+ becomes
408
+
409
+ &lt;div foo=&quot;bar&quot; hi=&quot;cat&quot;&gt;hello&lt;/div&gt;
410
+
411
+ You can put erb evaluated code in #{ } like in this example
412
+
413
+ &lt;div mv:attr=&quot;:foo =&gt; #{h product.name}, :hi =&gt; 'cat'&quot;&gt;hello&lt;/div&gt;
414
+
415
+ becomes
416
+
417
+ &lt;div foo=&quot;&lt;%= h product.name %&gt;&quot; hi=&quot;cat&quot;&gt;hello&lt;/div&gt;
418
+ </pre>
419
+
420
+ <a name="mv_content"></a>
421
+ <h4>mv:content</h4>
422
+ <p>
423
+ mv:content=&quot;foo&quot;
424
+ </p>
425
+ <pre>
426
+ Replaces the content of the tag with the erb output of foo, for example...
427
+
428
+ &lt;div mv:content=&quot;foo&quot;&gt;some dummy html here&lt;/div&gt;
429
+
430
+ becomes
431
+
432
+ &lt;div&gt;&lt;%= foo %&gt;&lt;/div&gt;
433
+ </pre>
434
+
435
+ <a name="mv_omit_tag"></a>
436
+ <h4>mv:omit_tag</h4>
437
+ <p>
438
+ mv:omit_tag=&quot;evalString&quot;
439
+ </p>
440
+ <pre>
441
+ Omit the element tag if the evalString is empty or evaluates to true. For example...
442
+
443
+ &lt;span mv:omit_tag=&quot;&quot;&gt;hello&lt;/span&gt;
444
+
445
+ becomes
446
+
447
+ hello
448
+
449
+ &lt;span mv:omit_tag=&quot;@test&quot;&gt;hello&lt;/span&gt;
450
+
451
+ becomes
452
+
453
+ &lt;% if @test %&gt;&lt;span&gt;&lt;% end %&gt;hello&lt;% if @test %&gt;&lt;/span&gt;&lt;% end %&gt;
454
+ </pre>
455
+ <a name="mv_replace"></a>
456
+ <h4>mv:replace</h4>
457
+ <p>
458
+ mv:replace=&quot;foo bar&quot;
459
+ </p>
460
+ <pre>
461
+ Replaces the tag and contents with the erb executed output of the attribute. If the attribute
462
+ value is an empty string then the tag is simply removed and nothing is output, for example...
463
+
464
+ &lt;span mv:replace=&quot;h product.name&quot;&gt;dummy product name&lt;/span&gt;
465
+
466
+ becomes
467
+
468
+ &lt;%= h product.name %&gt;
469
+
470
+ and similarly, you can use this to remove dummy html which was there for prototyping/demoing
471
+
472
+ &lt;table&gt;
473
+ other rows here
474
+ &lt;tr mv:replace=&quot;&quot;&gt;
475
+ &lt;td&gt;foo&lt;/td&gt;
476
+ &lt;td&gt;bar&lt;/td&gt;
477
+ &lt;/tr&gt;
478
+ &lt;/table&gt;
479
+
480
+ becomes
481
+
482
+ &lt;table&gt;
483
+ other rows here
484
+ &lt;/table&gt;
485
+
486
+ Passing in an empty attribute simply eliminated the tag, children, and contents
487
+ </pre>
488
+
489
+ <a name="erb_control_directives"></a>
490
+ <h3>Erb and Control Flow Directives</h3>
491
+
492
+ <a name="mv_block"></a>
493
+ <h4>mv:block</h4>
494
+ <p>
495
+ mv:block=&quot;rubyBlockCodeHere&quot;
496
+ </p>
497
+ <pre>
498
+ At runtime this expands to the equivalent rhtml (erb) block code around this element, for example...
499
+
500
+ &lt;div mv:block=&quot;products.each do |product|&quot;&gt;foobar&lt;/div&gt;
501
+
502
+ becomes
503
+
504
+ &lt;% products.each do |product| %&gt;
505
+ &lt;div&gt;foobar&lt;/div&gt;
506
+ &lt;% end %&gt;
507
+
508
+ Note how MasterView automatically put in the 'end' after the closing tag.
509
+ Another example using the brace form of a block
510
+
511
+ &lt;div mv:block=&quot;products.each { |product|&quot;&gt;foobar&lt;/div&gt;
512
+
513
+ becomes
514
+
515
+ &lt;% products.each { |product| %&gt;
516
+ &lt;div&gt;foobar&lt;/div&gt;
517
+ &lt;% } %&gt;
518
+
519
+ Its all based on the ruby and rails syntax while keeping things xhtml and designer friendly.
520
+ </pre>
521
+
522
+ <a name="mv_if"></a>
523
+ <h4>mv:if</h4>
524
+ <p>
525
+ mv:if=&quot;yourIfConditionHere&quot;
526
+ </p>
527
+ <pre>
528
+ Wraps the tag with an if block using the attribute contents for the condition, for example...
529
+
530
+ &lt;div mv:if=&quot;@flash[:notice]&quot;&gt;foo&lt;/div&gt;
531
+
532
+ becomes
533
+
534
+ &lt;% if @flash[:notice] %&gt;
535
+ &lt;div&gt;foo&lt;/div&gt;
536
+ &lt;% end %&gt;
537
+
538
+ And combining if and content directives we can do the following
539
+
540
+ &lt;div mv:if=&quot;@flash[:notice]&quot; mv:content=&quot;@flash[:notice]&quot; class=&quot;messages&quot;&gt;
541
+ dummy notice message here
542
+ &lt;/div&gt;
543
+
544
+ becomes
545
+
546
+ &lt;% if @flash[:notice] %&gt;
547
+ &lt;div&gt;
548
+ &lt;%= @flash[:notice] %&gt;
549
+ &lt;/div&gt;
550
+ &lt;% end %&gt;
551
+ </pre>
552
+
553
+ <a name="mv_elsif"></a>
554
+ <h4>mv:elsif</h4>
555
+ <p>
556
+ mv:elsif=&quot;yourElseConditionHere&quot;
557
+ </p>
558
+ <pre>
559
+ Used in conjunction with an if directive allows you to create if, elsif blocks, for example...
560
+
561
+ &lt;div mv:if=&quot;foo()&quot;&gt;
562
+ hello
563
+ &lt;/div&gt;
564
+ &lt;div mv:elsif=&quot;bar()&quot;&gt;
565
+ world
566
+ &lt;/div&gt;
567
+
568
+ becomes
569
+
570
+ &lt;% if foo() %&gt;
571
+ &lt;div&gt;
572
+ hello
573
+ &lt;/div&gt;
574
+ &lt;% elsif bar() %&gt;
575
+ &lt;div&gt;
576
+ world
577
+ &lt;/div&gt;
578
+ &lt;% end %&gt;
579
+
580
+ Note that the elsif directive element needs to follow the if element's closing tag
581
+ </pre>
582
+
583
+ <a name="mv_else"></a>
584
+ <h4>mv:else</h4>
585
+ <p>
586
+ mv:else=&quot;&quot;
587
+ </p>
588
+ <pre>
589
+ Used in conjunction with if and elsif, allows you to create if, elseif, else blocks, for example...
590
+
591
+ &lt;div mv:if=&quot;@foo&quot;&gt;
592
+ hello
593
+ &lt;/div&gt;
594
+ &lt;div mv:else=&quot;&quot;&gt;
595
+ world
596
+ &lt;/div&gt;
597
+
598
+ becomes
599
+
600
+ &lt;% if @foo %&gt;
601
+ &lt;div&gt;
602
+ hello
603
+ &lt;/div&gt;
604
+ &lt;% else %&gt;
605
+ &lt;div&gt;
606
+ world
607
+ &lt;/div&gt;
608
+ &lt;% end %&gt;
609
+ </pre>
610
+
611
+ <a name="mv_inline_erb"></a>
612
+ <h4>Inline Erb substitutions</h4>
613
+ <p>
614
+ Inline substitutions
615
+ </p>
616
+ <pre>
617
+ Since &lt;%= foobar %&gt; and &lt;% foo %&gt; are invalid xhtml values, MasterView has an inline substitution to
618
+ replace these for the cases when you simply want to inject something. {{{ gets replaced with &lt;%
619
+ and {{{= gets replaced with &lt;%= also }}} gets replaced with %&gt; If you instead want to use the
620
+ old &lt;% syntax instead, MasterView by default is setup to perform a substitution on those values before
621
+ parsing. However to be safe you should use the xhtml safe syntax otherwise html editors might end
622
+ up changing things on you.
623
+
624
+ {{{= foobar }}}
625
+
626
+ becomes
627
+
628
+ &lt;%= foobar %&gt;
629
+
630
+ and
631
+
632
+ {{{ foo }}}
633
+
634
+ becomes
635
+
636
+ &lt;% foo %&gt;
637
+ </pre>
638
+
639
+ <a name="asset_link_directives"></a>
640
+ <h3>Rails Asset and Link Helper Directives</h3>
641
+
642
+ <a name="mv_javascript_include"></a>
643
+ <h4>mv:javascript_include</h4>
644
+ <p>
645
+ mv:javascript_include=&quot;prototype.js&quot;
646
+ </p>
647
+ <pre>
648
+ Replaces the tag with a javascript_include_tag helper, for example...
649
+
650
+ &lt;script type=&quot;text/javascript&quot; src=&quot;../../../public/javascripts/prototype.js&quot;
651
+ mv:javascript_include=&quot;prototype.js&quot;&gt;&lt;/script&gt;
652
+
653
+ becomes
654
+
655
+ &lt;%= javascript_include_tag 'prototype.js' %&gt;
656
+
657
+ This is useful to allow scripts to be used for demos/prototypes and then at runtime
658
+ use the appropriate asset using the rails helper.
659
+ </pre>
660
+
661
+ <a name="mv_link_to"></a>
662
+ <h4>mv:link_to</h4>
663
+ <p>
664
+ mv:link_to=&quot;linkToOptions&quot;
665
+ </p>
666
+ <pre>
667
+ Replaces the tag with a link_to helper, it uses the contents of the tag for the name of the link,
668
+ so the name of the link can be changed by the html designer and it gets used in the appropriate place
669
+ in the helper, for example...
670
+
671
+ &lt;a mv:link_to=&quot;:action =&gt; 'new'&quot;&gt;New product&lt;/a&gt;
672
+
673
+ becomes
674
+
675
+ &lt;%= link_to 'New product', :action =&gt; 'new' %&gt;
676
+ </pre>
677
+
678
+ <a name="mv_link_to_if"></a>
679
+ <h4>mv:link_to_if</h4>
680
+ <p>
681
+ mv:link_to_if=&quot;linkToIfConditionAndOption&quot;
682
+ </p>
683
+ <pre>
684
+ Replaces the tag with a link_to_if helper, uses the contents of the tag for the name of the
685
+ link so the name of the link can be changed by the html designer and it gets used in the appropriate
686
+ place in the helper, for example...
687
+
688
+ &lt;a mv:link_to_if=&quot;@product_pages.current.previous, { :page =&gt; @product_pages.current.previous }&quot;Previous page&quot;&lt;/a&gt;
689
+
690
+ becomes
691
+
692
+ &lt;%= link_to_if @product_pages.current.previous, 'Previous page', {:page =&gt; @product_pages.current.previous } %&gt;
693
+ </pre>
694
+
695
+ <a name="mv_link_to_remote"></a>
696
+ <h4>mv:link_to_remote</h4>
697
+ <p>
698
+ mv:link_to_remote=&quot;linkToRemoteOptions&quot;
699
+ </p>
700
+ <pre>
701
+ Replaces the tag with a link_to_remote helper, uses the contents of the tag for the name of the
702
+ link so the name of the link can be changed by the html designer and it gets used in the appropriate
703
+ place in the helper, for example...
704
+
705
+ &lt;a mv:link_to_remote=&quot;:action =&gt; 'new'&quot;&gt;New product&lt;/a&gt;
706
+
707
+ becomes
708
+
709
+ &lt;%= link_to_remote 'New product', :action =&gt; 'new' %&gt;
710
+ </pre>
711
+
712
+ <a name="mv_stylesheet_link"></a>
713
+ <h4>mv:stylesheet_link</h4>
714
+ <p>
715
+ mv:stylesheet_link=&quot;style&quot;
716
+ </p>
717
+ <pre>
718
+ Replaces the tag with a stylesheet_link_tag helper, for example...
719
+
720
+ &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../../../public/stylesheets/scaffold.css&quot; mv:stylesheet_link=&quot;scaffold&quot;/&gt;
721
+
722
+ becomes
723
+
724
+ &lt;%= stylesheet_link_tag &quot;scaffold&quot; %&gt;
725
+
726
+ This is useful to allow style to be used for demos/prototypes and then at runtime
727
+ use the appropriate asset using the rails helper.
728
+ </pre>
729
+
730
+ <a name="form_directives"></a>
731
+ <h3>Rails Form Helper Directives</h3>
732
+
733
+ <a name="mv_form"></a>
734
+ <h4>mv:form</h4>
735
+ <p>
736
+ mv:form=&quot;:action =&gt; &#8216;new&#8217;&quot;
737
+ </p>
738
+ <pre>
739
+ Replaces this tag and closing tag with the form_tag and end_form_tag helpers. It also pulls the
740
+ method and multipart attributes from the element and merges that into the form_tag options, for example...
741
+
742
+ &lt;form mv:form=&quot;:action =&gt; 'new'&quot;&gt;foobar&lt;/form&gt;
743
+
744
+ becomes
745
+
746
+ &lt;% form_tag :action =&gt; 'new' %&gt;
747
+ foobar
748
+ &lt;% end_form_tag %&gt;
749
+
750
+ &lt;form method=&quot;GET&quot; mv:form=&quot;:action =&gt; 'new'&quot;&gt;foobar&lt;/form&gt;
751
+
752
+ becomes
753
+
754
+ &lt;% form_tag { :action =&gt; 'new' }, :method =&gt; 'GET' %&gt;
755
+ foobar
756
+ &lt;% end_form_tag %&gt;
757
+ </pre>
758
+
759
+ <a name="mv_hidden_field"></a>
760
+ <h4>mv:hidden_field</h4>
761
+ <p>
762
+ mv:hidden_field=&quot;object, method&quot;
763
+ </p>
764
+ <pre>
765
+ Replaces this tag with an hidden input tag using the rails hidden_tag helper, for example...
766
+
767
+ &lt;input mv:hidden_field=&quot;product, desc&quot; type=&quot;hidden&quot; value=&quot;dummy text&quot;/&gt;
768
+
769
+ becomes
770
+
771
+ &lt;%= hidden_field product, desc %&gt;
772
+ </pre>
773
+
774
+
775
+ <a name="mv_password_field"></a>
776
+ <h4>mv:password_field</h4>
777
+ <p>
778
+ mv:password_field=&quot;user, password&quot;
779
+ </p>
780
+ <pre>
781
+ Replaces the tag with a password_field helper using the attribute as well as merging any html
782
+ attributes that have been set by the designer, for example...
783
+
784
+ &lt;input type=&quot;password&quot; mv:password_field=&quot;user, password&quot;/&gt;
785
+
786
+ becomes
787
+
788
+ &lt;%= password_field user, password %&gt;
789
+
790
+ and similarly
791
+
792
+ &lt;input type=&quot;password&quot; mv:password_field=&quot;user, password&quot; size=&quot;10&quot; maxlength=&quot;15&quot; class=&quot;pwdStyle&quot;/&gt;
793
+
794
+ becomes
795
+
796
+ &lt;%= password_field, user, password, :class =&gt; 'pwdStyle', :maxlength = 15, :size =&gt; 10 %&gt;
797
+ </pre>
798
+
799
+ <a name="mv_submit"></a>
800
+ <h4>mv:submit</h4>
801
+ <p>
802
+ mv:submit=&quot;submitOptions&quot;
803
+ </p>
804
+ <pre>
805
+ Replaces the tag with a submit_tag helper, it uses the html value attribute to set the text
806
+ in the helper, and appends any options after, for example...
807
+
808
+ &lt;input type=&quot;submit&quot; mv:submit=&quot;&quot; value=&quot;Save product&quot;/&gt;
809
+
810
+ becomes
811
+
812
+ &lt;%= submit_tag 'Save product' %&gt;
813
+
814
+ and
815
+
816
+ &lt;input type=&quot;submit&quot; mv:submit=&quot;:foo =&gt; 'bar'&quot; value=&quot;Save product&quot;/&gt;
817
+
818
+ becomes
819
+
820
+ &lt;%= submit_tag 'Save product', :foo =&gt; 'bar' %&gt;
821
+ </pre>
822
+
823
+
824
+ <a name="mv_text_area"></a>
825
+ <h4>mv:text_area</h4>
826
+ <p>
827
+ mv:text_area=&quot;object, method&quot;
828
+ </p>
829
+ <pre>
830
+ Replaces the tag with a text_area helper, it uses the html attributes like rows, cols, disabled,
831
+ readonly, class, style, tabindex, accesskey and merges them with the object and method specified
832
+ in the attribute value, for example...
833
+
834
+ &lt;textarea mv:text_areas=&quot;product, desc&quot;&gt;dummy text&lt;/textarea&gt;
835
+
836
+ becomes
837
+
838
+ &lt;%= text_area prouct, desc %&gt;
839
+
840
+ or a more complex example
841
+
842
+ &lt;textarea mv:text_area=&quot;product, desc&quot; rows=&quot;4&quot; cols=&quot;60&quot;, class=&quot;mystyle&quot;&gt;dummy text&lt;/textarea&gt;
843
+
844
+ becomes
845
+
846
+ &lt;%= textarea product, desc, :class =&gt; 'mystyle', :cols =&gt; '60', :rows =&gt; 4 %&gt;
847
+ </pre>
848
+
849
+ <a name="mv_text_field"></a>
850
+ <h4>mv:text_field</h4>
851
+ <p>
852
+ mv:text_field=&quot;object, method&quot;
853
+ </p>
854
+ <pre>
855
+ Replaces the tag with a text_field helper, it uses the html attributes like size, maxlength,
856
+ disabled, readonly, class, style, tabindex, accesskey and merges them with the object and
857
+ method specified in the attribute value, for example...
858
+
859
+ &lt;input type=&quot;text&quot; mv:text_field=&quot;product, name&quot; value=&quot;dummy text&quot;/&gt;
860
+
861
+ becomes
862
+
863
+ &lt;%= text_field product, name %&gt;
864
+
865
+ and
866
+
867
+ &lt;input type=&quot;text&quot; mv:text_field=&quot;product, name&quot; value=&quot;dummy text&quot; class=&quot;mystyle&quot; size=&quot;15&quot; maxlength=&quot;20&quot;/&gt;
868
+
869
+ becomes
870
+
871
+ &lt;%= text_field product, name, :class =&gt; 'mystyle', :maxlength =&gt; 20, :size =&gt; 15 %&gt;
872
+ </pre>
873
+
874
+
875
+ <hr />
876
+ <a name="directives_index"></a>
877
+ <h2>Directives Index</h2>
878
+
879
+ <p>Directives index in alphabetical order:</p>
880
+
881
+ <table class="toc" summary="alphabetical index of directives">
882
+ <tbody>
883
+
884
+ <!-- a -->
885
+ <tr>
886
+ <td class="directive"><a href="#mv_attr">mv:attr</a></td>
887
+ <td>Replaces attribute value(s) on this element with the value of an expression</td>
888
+ </tr>
889
+
890
+ <!-- b -->
891
+ <tr>
892
+ <td class="directive"><a href="#mv_block">mv:block</a></td>
893
+ <td>Expands to the equivalent rhtml (erb) block code around this element</td>
894
+ </tr>
895
+
896
+ <!-- c -->
897
+ <tr>
898
+ <td class="directive"><a href="#mv_content">mv:content</a></td>
899
+ <td>Replaces the content of this element with the value of the expression</td>
900
+ </tr>
901
+
902
+ <!-- e -->
903
+ <tr>
904
+ <td class="directive"><a href="#mv_else">mv:else</a></td>
905
+ <td>Used in conjunction with the <span class="directiveName">mv:if</span> and <span class="directiveName">mv:elsif</span> directives to allow you to create <code>if... elsif... else... end</code> blocks</td>
906
+ </tr>
907
+
908
+ <!-- f -->
909
+ <tr>
910
+ <td class="directive"><a href="#mv_form">mv:form</a></td>
911
+ <td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> and <code>form_tag</code> helpers</td>
912
+ </tr>
913
+
914
+ <!-- g -->
915
+ <tr>
916
+ <td class="directive"><a href="#mv_generate">mv:generate</a></td>
917
+ <td>Generate output containing this element and its children</td>
918
+ </tr>
919
+ <tr>
920
+ <td class="directive"><a href="#mv_gen_partial">mv:gen_partial</a></td>
921
+ <td>Generate a Rails partial</td>
922
+ </tr>
923
+ <tr>
924
+ <td class="directive"><a href="#mv_gen_replace">mv:gen_replace</a></td>
925
+ <td>Used with <span class="directiveName">mv:generate</span> to replace the content of this element in the generated output with the value of the attribute</td>
926
+ </tr>
927
+
928
+ <!-- h -->
929
+ <tr>
930
+ <td class="directive"><a href="#mv_hidden_field">mv:hidden_field</a></td>
931
+ <td>Replaces this element with a <code>hidden</code> input element using the Rails <code>hidden_tag</code> helper.
932
+ <span class="explanation">(
933
+ Used on <code>&lt;input&gt;</code> form elements
934
+ )</span>
935
+ </td>
936
+ </tr>
937
+
938
+ <!-- i -->
939
+ <tr>
940
+ <td class="directive"><a href="#mv_if">mv:if</a></td>
941
+ <td>Wraps this element with an <code>if... end</code> block using the attribute contents for the condition</td>
942
+ </tr>
943
+ <tr>
944
+ <td class="directive"><a href="#mv_elsif">mv:elsif</a></td>
945
+ <td>Used in conjunction with the <span class="directiveName">mv:if</span> directive to allow you to create <code>if... elsif... end</code> blocks</td>
946
+ </tr>
947
+ <tr>
948
+ <td class="directive"><a href="#mv_import">mv:import</a></td>
949
+ <td>Design-time directive to mark a snapshot of generated code</td>
950
+ </tr>
951
+ <tr>
952
+ <td class="directive"><a href="#mv_import_render">mv:import_render</a></td>
953
+ <td>Design-time directive to mark a snapshot of generated partial code</td>
954
+ </tr>
955
+ <tr>
956
+ <td class="directive"><a href="#mv_inline_erb">Inline Erb substitutions </a></td>
957
+ <td>Inline substitution notation for Erb expressions</td>
958
+ </tr>
959
+
960
+ <!-- j -->
961
+ <tr>
962
+ <td class="directive"><a href="#mv_javascript_include">mv:javascript_include</a></td>
963
+ <td>Replaces this element using the Rails <code>javascript_include_tag</code> helper.
964
+ <span class="explanation">(
965
+ Used on <code>&lt;script&gt;</code> element in html header section
966
+ )</span>
967
+ </td>
968
+ </tr>
969
+
970
+ <!-- l -->
971
+ <tr>
972
+ <td class="directive"><a href="#mv_link_to">mv:link_to</a></td>
973
+ <td>Replaces this element using the Rails <code>link_to</code> helper.
974
+ <span class="explanation">(
975
+ Used on <code>&lt;a&gt;</code> link elements
976
+ )</span>
977
+ </td>
978
+ </tr>
979
+ <tr>
980
+ <td class="directive"><a href="#mv_link_to_if">mv:link_to_if</a></td>
981
+ <td>Replaces this element using the Rails <code>link_to_if</code> helper
982
+ <span class="explanation">(
983
+ Used on <code>&lt;a&gt;</code> link elements
984
+ )</span>
985
+ </td>
986
+ </tr>
987
+ <tr>
988
+ <td class="directive"><a href="#mv_link_to_remote">mv:link_to_remote</a></td>
989
+ <td>Replaces this element using the Rails <code>link_to_remote</code> helper
990
+ <span class="explanation">(
991
+ Used on <code>&lt;a&gt;</code> link elements
992
+ )</span>
993
+ </td>
994
+ </tr>
995
+
996
+ <!-- o -->
997
+ <tr>
998
+ <td class="directive"><a href="#mv_omit_tag">mv:omit_tag</a></td>
999
+ <td>Omits this element from the generated output if the value is empty or evaluates to true</td>
1000
+ </tr>
1001
+
1002
+ <!-- p -->
1003
+ <tr>
1004
+ <td class="directive"><a href="#mv_password_field">mv:password_field</a></td>
1005
+ <td>Replaces this element with a <code>password</code> input element using the Rails <code>password_field</code> helper.
1006
+ <span class="explanation">(
1007
+ Used on <code>&lt;input&gt;</code> form elements
1008
+ )</span>
1009
+ </td>
1010
+ </tr>
1011
+
1012
+ <!-- r -->
1013
+ <tr>
1014
+ <td class="directive"><a href="#mv_replace">mv:replace</a></td>
1015
+ <td>Replaces this element and its content with the value of the expression</td>
1016
+ </tr>
1017
+
1018
+ <!-- s -->
1019
+ <tr>
1020
+ <td class="directive"><a href="#mv_stylesheet_link">mv:stylesheet_link</a></td>
1021
+ <td>Replaces this element using the Rails <code>stylesheet_link_tag</code> helper
1022
+ <span class="explanation">(
1023
+ Used on stylesheet <code>&lt;link&gt;</code> elements in html header section
1024
+ )</span>
1025
+ </td>
1026
+ </tr>
1027
+ <tr>
1028
+ <td class="directive"><a href="#mv_submit">mv:submit</a></td>
1029
+ <td>Replaces this element with a <code>submit</code> input element using the Rails <code>submit_tag</code> helper.
1030
+ <span class="explanation">(
1031
+ Used on <code>&lt;input&gt;</code> form elements
1032
+ )</span>
1033
+ </td>
1034
+ </tr>
1035
+
1036
+ <!-- t -->
1037
+ <tr>
1038
+ <td class="directive"><a href="#mv_text_area">mv:text_area</a></td>
1039
+ <td>Replaces this element with a <code>textarea</code> input element using the Rails <code>text_area</code> helper.
1040
+ <span class="explanation">(
1041
+ Used on <code>&lt;textarea&gt;</code> form elements
1042
+ )</span>
1043
+ </td>
1044
+ </tr>
1045
+ <tr>
1046
+ <td class="directive"><a href="#mv_text_field">mv:text_field</a></td>
1047
+ <td>Replaces this element with a <code>text</code> input element using the Rails <code>text_field</code> helper.
1048
+ <span class="explanation">(
1049
+ Used on <code>&lt;input&gt;</code> form elements
1050
+ )</span>
1051
+ </td>
1052
+ </tr>
1053
+ </tbody>
1054
+ </table>
1055
+
1056
+ </div> <!-- bodyContent -->
1057
+ </div>
1058
+
1059
+ <div id="pageFooter">
1060
+ <div>
1061
+ &middot;&nbsp;
1062
+ <a href="./index.html">Doc Home</a>
1063
+ &nbsp;|&nbsp;
1064
+ <a href="./installation.html">Installation</a>
1065
+ &nbsp;|&nbsp;
1066
+ <a href="./configuration.html">Configuration</a>
1067
+ &nbsp;|&nbsp;
1068
+ <a href="./guide.html">Usage</a>
1069
+ &nbsp;|&nbsp;
1070
+ <a href="./directives.html">Directives</a>
1071
+ &nbsp;&middot;
1072
+ </div>
1073
+ <table summary="layout area">
1074
+ <tbody>
1075
+ <tr>
1076
+ <td class="copyright">&copy;&nbsp;Copyright MasterView 2006</td>
1077
+ <td class="validators">
1078
+ <a href="http://validator.w3.org/check/referer">[Valid XHTML]</a>
1079
+ </td>
1080
+ </tr>
1081
+ </tbody>
1082
+ </table>
1083
+ </div>
1084
+ </body>
1085
+ </html>