masterview 0.2.5 → 0.3.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.
- data/CHANGELOG +31 -1
- data/README +70 -69
- data/RELEASE_NOTES +70 -64
- data/Rakefile +26 -27
- data/TODO +13 -29
- data/doc/about.html +246 -0
- data/doc/configuration.html +49 -36
- data/doc/developer.html +423 -41
- data/doc/directives.html +139 -51
- data/doc/guide.html +19 -9
- data/doc/index.html +90 -224
- data/doc/installation.html +36 -28
- data/doc/media_list.html +30 -20
- data/doc/simple_diagram.html +3 -5
- data/doc/stylesheets/masterview.css +16 -1
- data/examples/rails_app_config/masterview/settings.rb +2 -1
- data/init.rb +1 -1
- data/lib/#ChangeLog# +6 -0
- data/lib/masterview/analyzer.rb +48 -34
- data/lib/masterview/attr_string_parser.rb +5 -1
- data/lib/masterview/case_insensitive_hash.rb +69 -0
- data/lib/masterview/{pathname_extensions.rb → core_ext/pathname.rb} +0 -0
- data/lib/masterview/{string_extensions.rb → core_ext/string.rb} +0 -0
- data/lib/masterview/deprecated/directive_base.rb +362 -0
- data/lib/masterview/directive_base.rb +201 -179
- data/lib/masterview/directive_dsl.rb +457 -0
- data/lib/masterview/directive_helpers.rb +28 -141
- data/lib/masterview/directive_load_path.rb +388 -0
- data/lib/masterview/directive_metadata.rb +377 -0
- data/lib/masterview/directive_registry.rb +259 -69
- data/lib/masterview/directives/.metadata +16 -0
- data/lib/masterview/directives/attr.rb +9 -8
- data/lib/masterview/directives/block.rb +11 -14
- data/lib/masterview/directives/check_box.rb +13 -18
- data/lib/masterview/directives/collection_select.rb +15 -29
- data/lib/masterview/directives/content.rb +9 -3
- data/lib/masterview/directives/else.rb +15 -13
- data/lib/masterview/directives/elsif.rb +14 -13
- data/lib/masterview/directives/eval.rb +20 -0
- data/lib/masterview/directives/form.rb +56 -9
- data/lib/masterview/directives/form_remote.rb +26 -0
- data/lib/masterview/directives/global_inline_erb.rb +10 -14
- data/lib/masterview/directives/hidden_field.rb +11 -20
- data/lib/masterview/directives/if.rb +13 -12
- data/lib/masterview/directives/image_tag.rb +20 -28
- data/lib/masterview/directives/import.rb +5 -12
- data/lib/masterview/directives/import_render.rb +7 -19
- data/lib/masterview/directives/insert_generated_comment.rb +8 -11
- data/lib/masterview/directives/javascript_include.rb +21 -12
- data/lib/masterview/directives/link_to.rb +14 -8
- data/lib/masterview/directives/link_to_function.rb +22 -0
- data/lib/masterview/directives/link_to_if.rb +15 -13
- data/lib/masterview/directives/link_to_remote.rb +13 -8
- data/lib/masterview/directives/omit_tag.rb +32 -16
- data/lib/masterview/directives/password_field.rb +10 -22
- data/lib/masterview/directives/radio_button.rb +11 -22
- data/lib/masterview/directives/replace.rb +7 -8
- data/lib/masterview/directives/select.rb +11 -24
- data/lib/masterview/directives/stylesheet_link.rb +20 -12
- data/lib/masterview/directives/submit.rb +11 -5
- data/lib/masterview/directives/text_area.rb +10 -23
- data/lib/masterview/directives/text_field.rb +10 -22
- data/lib/masterview/exceptions.rb +21 -0
- data/lib/masterview/extras/app/controllers/masterview_controller.rb +102 -75
- data/lib/masterview/extras/app/views/layouts/masterview_admin.rhtml +24 -23
- data/lib/masterview/extras/app/views/layouts/masterview_admin_config.rhtml +81 -0
- data/lib/masterview/extras/app/views/masterview/admin/configuration.rhtml +5 -1
- data/lib/masterview/extras/app/views/masterview/admin/create.rhtml +2 -2
- data/lib/masterview/extras/app/views/masterview/admin/directives.rhtml +5 -0
- data/lib/masterview/extras/app/views/masterview/admin/features.rhtml +5 -79
- data/lib/masterview/extras/app/views/masterview/admin/interact.rhtml +5 -0
- data/lib/masterview/extras/app/views/masterview/admin/list.rhtml +3 -71
- data/lib/masterview/extras/init_mv_admin_pages.rb +42 -23
- data/lib/masterview/filter_helpers.rb +26 -0
- data/lib/masterview/initializer.rb +99 -53
- data/lib/masterview/io.rb +19 -15
- data/lib/masterview/keyword_expander.rb +7 -2
- data/lib/masterview/masterview_info.rb +229 -23
- data/lib/masterview/masterview_version.rb +2 -2
- data/lib/masterview/parser.rb +275 -105
- data/lib/masterview/parser_helpers.rb +54 -0
- data/lib/masterview/rails_ext/action_controller_erb_direct.rb +29 -0
- data/lib/masterview/rails_ext/action_controller_reparse_checking.rb +27 -0
- data/lib/masterview/{extras/init_rails_erb_mv_direct.rb → rails_ext/action_view_erb_direct.rb} +12 -59
- data/lib/masterview/template_spec.rb +3 -2
- data/lib/masterview.rb +21 -12
- data/lib/rexml/parsers/baseparser_with_doctype_fix.rb +473 -0
- data/lib/rexml/parsers/sax2parser_with_doctype_fix.rb +243 -0
- data/test/directive_test_helper.rb +135 -0
- data/test/fixtures/directives/id_check.rb +18 -0
- data/test/fixtures/directives/test_directive_events.rb +70 -0
- data/test/test_helper.rb +18 -5
- data/test/tmp/views/layouts/product.rhtml +10 -10
- data/test/tmp/views/product/_form.rhtml +4 -4
- data/test/tmp/views/product/_product.rhtml +3 -3
- data/test/tmp/views/product/destroy.rhtml +5 -5
- data/test/tmp/views/product/edit.rhtml +4 -4
- data/test/tmp/views/product/list.rhtml +3 -3
- data/test/tmp/views/product/new.rhtml +4 -4
- data/test/tmp/views/product/show.rhtml +2 -2
- data/test/unit/attr_string_parser_test.rb +105 -0
- data/test/unit/case_insensitive_hash_mod_test.rb +104 -0
- data/test/unit/config_settings_test.rb +13 -1
- data/test/unit/default_generate_mio_filter_test.rb +3 -3
- data/test/unit/deprecated_directive_base_test.rb +30 -0
- data/test/unit/directive_attr_test.rb +111 -35
- data/test/unit/directive_base_test.rb +520 -1
- data/test/unit/directive_block_test.rb +30 -22
- data/test/unit/directive_content_test.rb +24 -11
- data/test/unit/directive_else_test.rb +18 -15
- data/test/unit/directive_elsif_test.rb +17 -15
- data/test/unit/directive_form_remote_test.rb +59 -0
- data/test/unit/directive_form_test.rb +31 -39
- data/test/unit/directive_global_inline_erb_test.rb +28 -17
- data/test/unit/directive_grid_test_notready.rb +38 -0
- data/test/unit/directive_helpers_test.rb +39 -0
- data/test/unit/directive_hidden_field_test.rb +44 -29
- data/test/unit/directive_if_test.rb +10 -7
- data/test/unit/directive_image_tag_test.rb +69 -61
- data/test/unit/directive_import_render_test.rb +28 -38
- data/test/unit/directive_import_test.rb +16 -14
- data/test/unit/directive_insert_generated_comment_test.rb +32 -0
- data/test/unit/directive_javascript_include_test.rb +40 -43
- data/test/unit/directive_link_to_function_test.rb +40 -0
- data/test/unit/directive_link_to_if_test.rb +52 -12
- data/test/unit/directive_link_to_remote_test.rb +58 -0
- data/test/unit/directive_link_to_test.rb +46 -31
- data/test/unit/directive_load_path_test.rb +257 -0
- data/test/unit/directive_metadata_test.rb +313 -0
- data/test/unit/directive_omit_tag_test.rb +73 -21
- data/test/unit/directive_password_field_test.rb +44 -38
- data/test/unit/directive_registry_test.rb +44 -0
- data/test/unit/directive_replace_test.rb +28 -12
- data/test/unit/directive_stylesheet_link_test.rb +43 -36
- data/test/unit/directive_submit_test.rb +29 -30
- data/test/unit/directive_text_area_test.rb +40 -36
- data/test/unit/directive_text_field_test.rb +44 -38
- data/test/unit/example_directive_child_events_test.rb +41 -0
- data/test/unit/example_test.rb +31 -4
- data/test/unit/file_mio_test.rb +18 -13
- data/test/unit/filter_helpers_test.rb +10 -8
- data/test/unit/find_directive_parent_test.rb +174 -0
- data/test/unit/keyword_expander_test.rb +4 -2
- data/test/unit/mio_test.rb +18 -11
- data/test/unit/mtime_string_hash_mio_tree_test.rb +5 -1
- data/test/unit/parser_test.rb +41 -29
- data/test/unit/pathname_extensions_test.rb +1 -1
- data/test/unit/run_parser_test.rb +2 -2
- data/test/unit/simplified_directive_base_test.rb +256 -0
- data/test/unit/string_hash_mio_test.rb +5 -1
- data/test/unit/template_file_watcher_test.rb +2 -2
- data/test/unit/template_test.rb +221 -46
- metadata +86 -45
- data/lib/masterview/directives/testfilter.rb +0 -55
- data/lib/masterview/extras/init_rails_reparse_checking.rb +0 -62
data/doc/directives.html
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
2
|
+
<!DOCTYPE html
|
3
3
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
4
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
5
|
+
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
8
|
|
@@ -25,6 +25,8 @@
|
|
25
25
|
·
|
26
26
|
<a href="./index.html">Doc Home</a>
|
27
27
|
|
|
28
|
+
<a href="./about.html">About</a>
|
29
|
+
|
|
28
30
|
<a href="./installation.html">Installation</a>
|
29
31
|
|
|
30
32
|
<a href="./configuration.html">Configuration</a>
|
@@ -32,8 +34,10 @@
|
|
32
34
|
<a href="./guide.html">Usage</a>
|
33
35
|
|
|
34
36
|
<a href="./directives.html">Directives</a>
|
35
|
-
 
|
36
|
-
<a href="./
|
37
|
+
|
|
38
|
+
<a href="./developer.html">Developers</a>
|
39
|
+
|
|
40
|
+
<a href="./media_list.html">Screencasts</a>
|
37
41
|
·
|
38
42
|
</div>
|
39
43
|
</div>
|
@@ -41,7 +45,7 @@
|
|
41
45
|
<div id="pageBody">
|
42
46
|
<div id="bodyContent">
|
43
47
|
|
44
|
-
<h1>MasterView
|
48
|
+
<h1>MasterView Directives Reference</h1>
|
45
49
|
|
46
50
|
<p>MasterView template processing directives are encoded in an (x)html template
|
47
51
|
using attribute markup. A MasterView directive is an element attribute
|
@@ -81,8 +85,8 @@ file being processed that can be used in attribute values for the
|
|
81
85
|
<p>A typical use would be to specify the generated output for the main content
|
82
86
|
of a template <code>one/two/foo.html</code> with the directive
|
83
87
|
<code>mv:generate="{template_path}"</code>.
|
84
|
-
This keyword notation avoids the need to replicate the template's own file name or
|
85
|
-
it's relative path within the Rails <code>app/views</code> directory in the
|
88
|
+
This keyword notation avoids the need to replicate the template's own file name or
|
89
|
+
it's relative path within the Rails <code>app/views</code> directory in the
|
86
90
|
directive markup in the template.
|
87
91
|
</p>
|
88
92
|
|
@@ -91,9 +95,9 @@ directive markup in the template.
|
|
91
95
|
Typically MasterView template files will contain mv:generate or mv:gen_partial directives
|
92
96
|
to tell MasterView where to output the rendered rhtml. However if none are found in the template
|
93
97
|
file, MasterView will automatically add in a mv:generate="{template_path}" to the body tag
|
94
|
-
if found otherwise the root element. Additionally if MasterView was adding this to the body tag,
|
95
|
-
it will add in a mv:omit_tag="" which will prevent the body tag from being included in the generated
|
96
|
-
output. If you wish to disable this default generate mechanism, set the
|
98
|
+
if found otherwise the root element. Additionally if MasterView was adding this to the body tag,
|
99
|
+
it will add in a mv:omit_tag="" which will prevent the body tag from being included in the generated
|
100
|
+
output. If you wish to disable this default generate mechanism, set the
|
97
101
|
config.default_parser_options[:default_generate] = false in your masterview settings or
|
98
102
|
environments files.
|
99
103
|
</p>
|
@@ -154,6 +158,10 @@ environments files.
|
|
154
158
|
<td>Expands to the equivalent rhtml (erb) block code around this element</td>
|
155
159
|
</tr>
|
156
160
|
<tr>
|
161
|
+
<td class="directive"><a href="#mv_eval">mv:eval</a></td>
|
162
|
+
<td>Inserts an rhtml evaluation expression for the attribute value prior to this element</td>
|
163
|
+
</tr>
|
164
|
+
<tr>
|
157
165
|
<td class="directive"><a href="#mv_if">mv:if</a></td>
|
158
166
|
<td>Wraps this element with an <code>if... end</code> block using the attribute contents for the condition</td>
|
159
167
|
</tr>
|
@@ -198,6 +206,14 @@ Used on <code><a></code> link elements
|
|
198
206
|
</td>
|
199
207
|
</tr>
|
200
208
|
<tr>
|
209
|
+
<td class="directive"><a href="#mv_link_to_function">mv:link_to_function</a></td>
|
210
|
+
<td>Replaces this element using the Rails <code>link_to_function</code> helper which creates a link which calls a JavaScript function.
|
211
|
+
<span class="explanation">(
|
212
|
+
Used on <code><a></code> link elements
|
213
|
+
)</span>
|
214
|
+
</td>
|
215
|
+
</tr>
|
216
|
+
<tr>
|
201
217
|
<td class="directive"><a href="#mv_link_to_if">mv:link_to_if</a></td>
|
202
218
|
<td>Replaces this element using the Rails <code>link_to_if</code> helper
|
203
219
|
<span class="explanation">(
|
@@ -239,7 +255,11 @@ Used on <code><select></code> form elements
|
|
239
255
|
</tr>
|
240
256
|
<tr>
|
241
257
|
<td class="directive"><a href="#mv_form">mv:form</a></td>
|
242
|
-
<td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> and
|
258
|
+
<td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> helper and closing form tag</td>
|
259
|
+
</tr>
|
260
|
+
<tr>
|
261
|
+
<td class="directive"><a href="#mv_form_remote">mv:form_remote</a></td>
|
262
|
+
<td>Replaces the start and end tags of this element using the Rails <code>form_remote_tag</code> helper and a closing form tag for Ajax-enabled form submission using the Prototype library</td>
|
243
263
|
</tr>
|
244
264
|
<tr>
|
245
265
|
<td class="directive"><a href="#mv_hidden_field">mv:hidden_field</a></td>
|
@@ -584,6 +604,27 @@ mv:block="rubyBlockCodeHere"
|
|
584
604
|
Its all based on the ruby and rails syntax while keeping things xhtml and designer friendly.
|
585
605
|
</pre>
|
586
606
|
|
607
|
+
<a name="mv_eval"></a>
|
608
|
+
<h4>mv:eval</h4>
|
609
|
+
<p>
|
610
|
+
mv:eval="rubyExpression"
|
611
|
+
</p>
|
612
|
+
<pre>
|
613
|
+
At runtime this causes an rhtml evaluation expression for the attribute value
|
614
|
+
to be inserted into the output preceding this element, for example...
|
615
|
+
|
616
|
+
<table mv:eval="num_alerts = 0">
|
617
|
+
... some table content here ...
|
618
|
+
</table>
|
619
|
+
|
620
|
+
becomes
|
621
|
+
|
622
|
+
<% num_alerts = 0 %>
|
623
|
+
<table>
|
624
|
+
... some table content here ...
|
625
|
+
</table>
|
626
|
+
</pre>
|
627
|
+
|
587
628
|
<a name="mv_if"></a>
|
588
629
|
<h4>mv:if</h4>
|
589
630
|
<p>
|
@@ -711,7 +752,7 @@ mv:image_tag="cat.jpg"
|
|
711
752
|
</p>
|
712
753
|
<pre>
|
713
754
|
Replaces the tag with a image_tag helper, size is determined by width and height, other html attributes
|
714
|
-
|
755
|
+
are passed through. for example...
|
715
756
|
|
716
757
|
<img src="../../../public/images/cat.jpg" mv:image_tag="cat.jpg"/>
|
717
758
|
|
@@ -726,8 +767,8 @@ mv:image_tag="cat.jpg"
|
|
726
767
|
|
727
768
|
<%= image_tag 'cat.jpg', :alt => 'my cat', :size => '20x10' %>
|
728
769
|
|
729
|
-
|
730
|
-
|
770
|
+
Also if path isn't specified in the mv:image_tag attribute value then it will infer the path looking
|
771
|
+
for what follows the public/images/ in the src atttribute, like so
|
731
772
|
|
732
773
|
<img src="../../../public/images/cat.jpg" mv:image_tag=""/>
|
733
774
|
|
@@ -754,7 +795,7 @@ mv:javascript_include="prototype.js"
|
|
754
795
|
|
755
796
|
<%= javascript_include_tag 'prototype.js' %>
|
756
797
|
|
757
|
-
|
798
|
+
You can also use a symbol
|
758
799
|
|
759
800
|
<script type="text/javascript" src="../../../public/javascripts/prototype.js"
|
760
801
|
mv:javascript_include=":defaults"></script>
|
@@ -763,7 +804,7 @@ mv:javascript_include="prototype.js"
|
|
763
804
|
|
764
805
|
<%= javascript_include_tag :defaults %>
|
765
806
|
|
766
|
-
|
807
|
+
And you can have the path inferred from the src path (uses the relative path to public/javascripts)
|
767
808
|
|
768
809
|
<script type="text/javascript" src="../../../public/javascripts/prototype.js"
|
769
810
|
mv:javascript_include=""></script>
|
@@ -793,6 +834,21 @@ mv:link_to="linkToOptions"
|
|
793
834
|
<%= link_to 'New product', :action => 'new' %>
|
794
835
|
</pre>
|
795
836
|
|
837
|
+
<a name="mv_link_to_function"></a>
|
838
|
+
<h4>mv:link_to_function</h4>
|
839
|
+
<p>
|
840
|
+
mv:link_to_function="mv:link_to_if="function, options""
|
841
|
+
</p>
|
842
|
+
<pre>
|
843
|
+
Replaces the tag with a link_to_function helper. The attribute values
|
844
|
+
contains the function to call, along with optional keyword arguments
|
845
|
+
to pass to the link_to_function helper. The content of the element
|
846
|
+
is used as the function name.
|
847
|
+
|
848
|
+
### todo: add example here ###
|
849
|
+
|
850
|
+
</pre>
|
851
|
+
|
796
852
|
<a name="mv_link_to_if"></a>
|
797
853
|
<h4>mv:link_to_if</h4>
|
798
854
|
<p>
|
@@ -862,8 +918,8 @@ mv:stylesheet_link="style"
|
|
862
918
|
mv:check_box="product, name"
|
863
919
|
</p>
|
864
920
|
<pre>
|
865
|
-
Replaces this element with the check_box helper. It quotes the object and name if necessary, and merges any
|
866
|
-
|
921
|
+
Replaces this element with the check_box helper. It quotes the object and name if necessary, and merges any
|
922
|
+
html attributes into options if supplied
|
867
923
|
|
868
924
|
<input type="checkbox" mv:check_box="product, name"/>
|
869
925
|
|
@@ -871,7 +927,7 @@ mv:check_box="product, name"
|
|
871
927
|
|
872
928
|
<% check_box 'product', 'name' %>
|
873
929
|
|
874
|
-
|
930
|
+
and
|
875
931
|
|
876
932
|
<input type="checkbox" class="green" id="cb1" mv:check_box="product, name, {:readonly => true}, 'yes,', 'no'"/>
|
877
933
|
|
@@ -888,14 +944,14 @@ mv:collection_select="product, category, Category.find_all, id, name"
|
|
888
944
|
</p>
|
889
945
|
<pre>
|
890
946
|
Replaces the tag with a select helper, it quotes the object and method if necessary, and
|
891
|
-
|
947
|
+
merges any html attributes into the html_options
|
948
|
+
|
892
949
|
|
950
|
+
<select mv:collection_select="product, category, Category.find_all, id, name">
|
951
|
+
<option>One</option>
|
952
|
+
<option>One</option>
|
953
|
+
</select>
|
893
954
|
|
894
|
-
<select mv:collection_select="product, category, Category.find_all, id, name">
|
895
|
-
<option&>One</option>
|
896
|
-
<option&>One</option>
|
897
|
-
</select>
|
898
|
-
|
899
955
|
becomes
|
900
956
|
|
901
957
|
<%= collection_select 'product', 'category', Category.find_all, 'id', 'name' %>
|
@@ -903,11 +959,11 @@ mv:collection_select="product, category, Category.find_all, id, name"
|
|
903
959
|
and
|
904
960
|
|
905
961
|
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
962
|
+
<select size="3" mv:collection_select="product, category, Category.find_all, id, name, {}, :readonly => true ">
|
963
|
+
<option>One</option>
|
964
|
+
<option>One</option>
|
965
|
+
</select>
|
966
|
+
|
911
967
|
|
912
968
|
becomes
|
913
969
|
|
@@ -922,24 +978,34 @@ mv:collection_select="product, category, Category.find_all, id, name"
|
|
922
978
|
mv:form=":action => ‘new’"
|
923
979
|
</p>
|
924
980
|
<pre>
|
925
|
-
Replaces this tag and closing tag with the form_tag and
|
981
|
+
Replaces this tag and closing tag with the form_tag helper and a closing form tag. It also pulls the
|
926
982
|
method and multipart attributes from the element and merges that into the form_tag options, for example...
|
927
983
|
|
928
984
|
<form mv:form=":action => 'new'">foobar</form>
|
929
985
|
|
930
986
|
becomes
|
931
987
|
|
932
|
-
<
|
988
|
+
<%= form_tag( :action => 'new') %>
|
933
989
|
foobar
|
934
|
-
<
|
990
|
+
</form>
|
935
991
|
|
936
992
|
<form method="GET" mv:form=":action => 'new'">foobar</form>
|
937
993
|
|
938
994
|
becomes
|
939
995
|
|
940
|
-
<
|
996
|
+
<%= form_tag( { :action => 'new' }, :method => 'GET') %>
|
941
997
|
foobar
|
942
|
-
<
|
998
|
+
</form>
|
999
|
+
</pre>
|
1000
|
+
|
1001
|
+
<a name="mv_form_remote"></a>
|
1002
|
+
<h4>mv:form_remote</h4>
|
1003
|
+
<p>
|
1004
|
+
mv:form_remote=":action => ‘ url_for(:controller => "some", :action => "place")’"
|
1005
|
+
</p>
|
1006
|
+
<pre>
|
1007
|
+
Replaces this tag and closing tag with the form_remote_tag helper and a closing form tag
|
1008
|
+
### needs work - fix prototype and add example ###
|
943
1009
|
</pre>
|
944
1010
|
|
945
1011
|
<a name="mv_hidden_field"></a>
|
@@ -989,7 +1055,7 @@ mv:radio_button="product, category, 'clothing'"
|
|
989
1055
|
</p>
|
990
1056
|
<pre>
|
991
1057
|
Replaces the tag with a radio_button helper, it quotes the object and method if necessary, and
|
992
|
-
|
1058
|
+
merges any html attributes into the options
|
993
1059
|
|
994
1060
|
|
995
1061
|
<input type="radio" mv:radio_button="product, category, 'clothing'"/>
|
@@ -1015,14 +1081,14 @@ mv:select="product, category, Category.find_all.collect{|c| [c.name, c.id]}
|
|
1015
1081
|
</p>
|
1016
1082
|
<pre>
|
1017
1083
|
Replaces the tag with a select helper, it quotes the object and method if necessary, and
|
1018
|
-
|
1084
|
+
merges any html attributes into the html_options
|
1085
|
+
|
1019
1086
|
|
1087
|
+
<select mv:select="product, category, Category.find_all.collect{|c| [c.name, c.id]}">
|
1088
|
+
<option>One</option>
|
1089
|
+
<option>One</option>
|
1090
|
+
</select>
|
1020
1091
|
|
1021
|
-
<select mv:select="product, category, Category.find_all.collect{|c| [c.name, c.id]}">
|
1022
|
-
<option&>One</option>
|
1023
|
-
<option&>One</option>
|
1024
|
-
</select>
|
1025
|
-
|
1026
1092
|
becomes
|
1027
1093
|
|
1028
1094
|
<%= select 'product', 'category', Category.find_all.collect{|c| [c.name, c.id]} %>
|
@@ -1030,11 +1096,11 @@ mv:select="product, category, Category.find_all.collect{|c| [c.name, c.id]}
|
|
1030
1096
|
and
|
1031
1097
|
|
1032
1098
|
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1099
|
+
<select size="3" mv:select="product, category, Category.find_all.collect{|c| [c.name, c.id]}, {}, :readonly => true ">
|
1100
|
+
<option>One</option>
|
1101
|
+
<option>One</option>
|
1102
|
+
</select>
|
1103
|
+
|
1038
1104
|
|
1039
1105
|
becomes
|
1040
1106
|
|
@@ -1167,11 +1233,19 @@ Used on <code><select></code> form elements
|
|
1167
1233
|
<td class="directive"><a href="#mv_elsif">mv:elsif</a></td>
|
1168
1234
|
<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>
|
1169
1235
|
</tr>
|
1236
|
+
<tr>
|
1237
|
+
<td class="directive"><a href="#mv_eval">mv:eval</a></td>
|
1238
|
+
<td>Inserts an rhtml evaluation expression for the attribute value prior to this element</td>
|
1239
|
+
</tr>
|
1170
1240
|
|
1171
1241
|
<!-- f -->
|
1172
1242
|
<tr>
|
1173
1243
|
<td class="directive"><a href="#mv_form">mv:form</a></td>
|
1174
|
-
<td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> and
|
1244
|
+
<td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> block helper and a closing form tag</td>
|
1245
|
+
</tr>
|
1246
|
+
<tr>
|
1247
|
+
<td class="directive"><a href="#mv_form_remote">mv:form_remote</a></td>
|
1248
|
+
<td>Replaces the start and end tags of this element using the Rails <code>form_remote_tag</code> helper and a closing form tag for Ajax-enabled form submission using the Prototype library</td>
|
1175
1249
|
</tr>
|
1176
1250
|
|
1177
1251
|
<!-- g -->
|
@@ -1244,6 +1318,14 @@ Used on <code><a></code> link elements
|
|
1244
1318
|
</td>
|
1245
1319
|
</tr>
|
1246
1320
|
<tr>
|
1321
|
+
<td class="directive"><a href="#mv_link_to_function">mv:link_to_function</a></td>
|
1322
|
+
<td>Replaces this element using the Rails <code>link_to_function</code> helper which creates a link which calls a JavaScript function.
|
1323
|
+
<span class="explanation">(
|
1324
|
+
Used on <code><a></code> link elements
|
1325
|
+
)</span>
|
1326
|
+
</td>
|
1327
|
+
</tr>
|
1328
|
+
<tr>
|
1247
1329
|
<td class="directive"><a href="#mv_link_to_if">mv:link_to_if</a></td>
|
1248
1330
|
<td>Replaces this element using the Rails <code>link_to_if</code> helper
|
1249
1331
|
<span class="explanation">(
|
@@ -1336,6 +1418,8 @@ Used on <code><input></code> form elements
|
|
1336
1418
|
·
|
1337
1419
|
<a href="./index.html">Doc Home</a>
|
1338
1420
|
|
|
1421
|
+
<a href="./about.html">About</a>
|
1422
|
+
|
|
1339
1423
|
<a href="./installation.html">Installation</a>
|
1340
1424
|
|
|
1341
1425
|
<a href="./configuration.html">Configuration</a>
|
@@ -1343,8 +1427,10 @@ Used on <code><input></code> form elements
|
|
1343
1427
|
<a href="./guide.html">Usage</a>
|
1344
1428
|
|
|
1345
1429
|
<a href="./directives.html">Directives</a>
|
1346
|
-
 
|
1347
|
-
<a href="./
|
1430
|
+
|
|
1431
|
+
<a href="./developer.html">Developers</a>
|
1432
|
+
|
|
1433
|
+
<a href="./media_list.html">Screencasts</a>
|
1348
1434
|
·
|
1349
1435
|
</div>
|
1350
1436
|
<table summary="layout area">
|
@@ -1352,7 +1438,9 @@ Used on <code><input></code> form elements
|
|
1352
1438
|
<tr>
|
1353
1439
|
<td class="copyright">© Copyright MasterView 2006</td>
|
1354
1440
|
<td class="validators">
|
1355
|
-
<a href="http://validator.w3.org/check/referer"><img
|
1441
|
+
<a href="http://validator.w3.org/check/referer"><img
|
1442
|
+
src="http://www.w3.org/Icons/valid-xhtml10" class="w3c_validator"
|
1443
|
+
title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
|
1356
1444
|
</td>
|
1357
1445
|
</tr>
|
1358
1446
|
</tbody>
|
data/doc/guide.html
CHANGED
@@ -24,6 +24,8 @@
|
|
24
24
|
·
|
25
25
|
<a href="./index.html">Doc Home</a>
|
26
26
|
|
|
27
|
+
<a href="./about.html">About</a>
|
28
|
+
|
|
27
29
|
<a href="./installation.html">Installation</a>
|
28
30
|
|
|
29
31
|
<a href="./configuration.html">Configuration</a>
|
@@ -31,8 +33,10 @@
|
|
31
33
|
<a href="./guide.html">Usage</a>
|
32
34
|
|
|
33
35
|
<a href="./directives.html">Directives</a>
|
34
|
-
 
|
35
|
-
<a href="./
|
36
|
+
|
|
37
|
+
<a href="./developer.html">Developers</a>
|
38
|
+
|
|
39
|
+
<a href="./media_list.html">Screencasts</a>
|
36
40
|
·
|
37
41
|
</div>
|
38
42
|
</div>
|
@@ -40,7 +44,7 @@
|
|
40
44
|
<div id="pageBody">
|
41
45
|
<div id="bodyContent">
|
42
46
|
|
43
|
-
<h1>MasterView
|
47
|
+
<h1>MasterView User's Guide</h1>
|
44
48
|
|
45
49
|
<p>
|
46
50
|
MasterView is designed to be easy
|
@@ -123,10 +127,10 @@ generating all parts to a single file for the ultimate in DRY.
|
|
123
127
|
<p>
|
124
128
|
For example, if our generated Controller name is Store and the Model is Product this is
|
125
129
|
what would be generated.<br/>
|
126
|
-
<table id="generatedRhtml">
|
130
|
+
<table id="generatedRhtml" summary="descriptions of generated scaffold templates">
|
127
131
|
<thead>
|
128
132
|
<tr>
|
129
|
-
<th>Template</
|
133
|
+
<th>Template</th>
|
130
134
|
<th>Contained rhtml parts</th>
|
131
135
|
</tr>
|
132
136
|
</thead>
|
@@ -167,7 +171,7 @@ what would be generated.<br/>
|
|
167
171
|
</tr>
|
168
172
|
</tbody>
|
169
173
|
</table>
|
170
|
-
|
174
|
+
|
171
175
|
<p>
|
172
176
|
By adding the —single-file switch MasterView will create a single file
|
173
177
|
and to make it easier to use this template at design time, some design time
|
@@ -283,6 +287,8 @@ rake -T
|
|
283
287
|
·
|
284
288
|
<a href="./index.html">Doc Home</a>
|
285
289
|
|
|
290
|
+
<a href="./about.html">About</a>
|
291
|
+
|
|
286
292
|
<a href="./installation.html">Installation</a>
|
287
293
|
|
|
288
294
|
<a href="./configuration.html">Configuration</a>
|
@@ -290,8 +296,10 @@ rake -T
|
|
290
296
|
<a href="./guide.html">Usage</a>
|
291
297
|
|
|
292
298
|
<a href="./directives.html">Directives</a>
|
293
|
-
 
|
294
|
-
<a href="./
|
299
|
+
|
|
300
|
+
<a href="./developer.html">Developers</a>
|
301
|
+
|
|
302
|
+
<a href="./media_list.html">Screencasts</a>
|
295
303
|
·
|
296
304
|
</div>
|
297
305
|
<table summary="layout area">
|
@@ -299,7 +307,9 @@ rake -T
|
|
299
307
|
<tr>
|
300
308
|
<td class="copyright">© Copyright MasterView 2006</td>
|
301
309
|
<td class="validators">
|
302
|
-
<a href="http://validator.w3.org/check/referer"
|
310
|
+
<a href="http://validator.w3.org/check/referer"><img
|
311
|
+
src="http://www.w3.org/Icons/valid-xhtml10" class="w3c_validator"
|
312
|
+
title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
|
303
313
|
</td>
|
304
314
|
</tr>
|
305
315
|
</tbody>
|