I’m trying to do something simple like…
In _email_header.rhtml
<% include “header.rhtml” %>
Where _header.rhtml looks like …
The wrinkle is that main.rhtml is a template.
I’m trying to clone the look of my pages in my email…
Thanks,
Jason
I’m trying to do something simple like…
In _email_header.rhtml
<% include “header.rhtml” %>
Where _header.rhtml looks like …
The wrinkle is that main.rhtml is a template.
I’m trying to clone the look of my pages in my email…
Thanks,
Jason
render :partial => “main.rhtml”
2007/5/15, Jason V. [email protected]:
<%= image_tag "logo.gif", :class => "logostyle" %> </ul>
This is from rails docs.
Rendering a template
Template rendering works just like action rendering except that it
takes a path relative to the template root. The current layout is
automatically applied.
[TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails,
app/views/weblog/show.rhtml)
render :template => “weblog/show”
Rendering a file
File rendering works just like action rendering except that it takes a
filesystem path. By default, the path is assumed to be absolute, and
the current layout is not applied.
render :file => “/path/to/some/template.rhtml”
render :file => “c:/path/to/some/template.rhtml”
code
render :file => “/path/to/some/template.rhtml”, :layout => true,
:status => 404
render :file => “c:/path/to/some/template.rhtml”, :layout => true,
:status => 404
proper file extension
render :file => “some/template”, :use_full_path => true
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