/
README_rdoc.html
127 lines (123 loc) · 5.35 KB
/
README_rdoc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<title>File: README.rdoc [inherit_views API Docs (e5ad25a)]</title>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<link href='.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
<script type='text/javascript'>
//<![CDATA[
function popupCode(url) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode(id) {
var code = document.getElementById(id)
code.style.display = code.style.display != 'block' ? 'block' : 'none'
return true
}
// Make codeblocks hidden by default
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
//]]>
</script>
</head>
<body class='page'>
<div class='file' id='wrapper'>
<div class='header'>
<div class='name'>README.rdoc</div>
<div class='paths'>
README.rdoc
</div>
<div class='last-update'>
Last Update:
<span class='datetime'>Fri Feb 13 12:01:14 +0000 2009</span>
</div>
</div>
<div id='content'>
<div id='text'>
<div id='description'>
<h1><a href="http://github.com/ianwhite">ianwhite</a> / <a href="http://github.com/ianwhite/inherit_views">inherit_views</a> >><a href="http://ianwhite.github.com/inherit_views">info</a> >><a href="http://ianwhite.github.com/inherit_views/doc">api</a></h1>
<h2>Status</h2>
<p>
inherit_views works with rails 2.x
</p>
<p>
If you’re on <b>rails master (2.3)</b>, you want <a
href="http://github.com/ianwhite/inherit_views/tree/master">inherit_views/master</a>
</p>
<p>
If you’re on <b>rails 2.2</b>, you want <a
href="http://github.com/ianwhite/inherit_views/tree/rails-2.2">inherit_views/rails-2.2</a>
</p>
<p>
If you’re on <b>rails 2.0, or 2.1</b>, you want <a
href="http://github.com/ianwhite/inherit_views/tree/rails-2.0-2.1">inherit_views/rails-2.0-2.1</a>
</p>
<h2>what does it do?</h2>
<p>
This rails plugin allows your controllers/mailers to inherit their views
from parent controllers/mailers. The default behaviour is to inherit along
the ancestor path of the controller/mailer, but you can also specify custom
inherit view paths to search.
</p>
<p>
Example:
</p>
<pre>class ApplicationController < ActionController::Base
 inherit_views
end

class FooController < ApplicationController
 # will look for views in 'views/foo', then 'views/application'
end

class BarController < FooController
 # will look for views in 'views/bar', then 'views/foo', then 'view/application'
end</pre>
<p>
See <a href="../classes/InheritViews.html">InheritViews</a> for more
details
</p>
<p>
NOTE: this plugin is not aimed at having multiple view paths for your
controllers, which is addressed with the view_paths addition to
ActionController::Base for rails 2.0. Rather, within these view paths, you
can inherit views from other controller paths.
</p>
<h2>In templates</h2>
<p>
You can render the ‘parent’ template from within a template if
you so choose. This works for partials and top-level templates alike.
</p>
<p>
<b>foo/view.html.erb</b>
</p>
<pre><h1>Foo View</h1></pre>
<p>
<b>bar/view.html.erb</b>
</p>
<pre><%= render :parent %>
<h2>With some 'bar' action</h2></pre>
<p>
rendering bar/view (with the controller setup described above):
</p>
<pre><h1>Foo View</h1>
<h2>With some 'bar' action</h2></pre>
<h2>Testing & CI</h2>
<p>
RSpec is used for testing, so the tests are in <tt>spec/</tt> rather than
<tt>test/</tt> Do rake —tasks for more details.
</p>
<p>
<a href="http://github.com/ianwhite/garlic">garlic</a> is used for CI, see
garlic.rb for details on what versions of rails are tested.
</p>
<h2>Contributors</h2>
<p>
Author: <a href="http://github.com/ianwhite">Ian W. White</a>
</p>
<p>
Contributions by:
</p>
<ul>
<li><a href="http://github.com/thedarkone">The Dark One</a>
</li>
</ul>
</div>
<div id='section'>
</div>
</div>
</div>
<div id='footer-push'></div>
</div>
<div id='footer'>
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
</div>
</body>
</html>