Is it possible to use a child model’s controller to impliment it’s
parents view before adding its own output ?
possibly by the use of super ?
_tony
Is it possible to use a child model’s controller to impliment it’s
parents view before adding its own output ?
possibly by the use of super ?
_tony
On 06/03/06, Anthony G. [email protected] wrote:
Is it possible to use a child model’s controller to impliment it’s
parents view before adding its own output ?
possibly by the use of super ?
Use partials, for example:
File _common.rhtml
File parent.rhtml
<%= render :partial => ‘common’ %>
File child.rhtml
<%= render :partial => ‘common’ %>
Let's add some new contents
Use partials, for example:
File _common.rhtml
Common parts
File parent.rhtml
<%= render :partial => ‘common’ %>
File child.rhtml
<%= render :partial => ‘common’ %>
Let's add some new contents
Doesn’t the partial have to be in the model named directory for that to
work ?
ie
views/child/_common.rhtml
whereas I want it to use
views/parent/_common.rhtml
_tony
views/parent/_common.rhtml
_tony
<%= render_partial ‘parent/common’, @user %>
_T
Hi Anthony,
On 06/03/06, Anthony G. [email protected] wrote:
Doesn’t the partial have to be in the model named directory for that to
work ?
ie
views/child/_common.rhtmlwhereas I want it to use
views/parent/_common.rhtml
It may be anywhere, you just have to provide a proper path:
app/views/
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs