Jason Vogel
2007-May-15 05:49 UTC
How to include another rhtml from an rhtml (no controller)...
I''m trying to do something simple like... In _email_header.rhtml <% include "header.rhtml" %> Where _header.rhtml looks like ... <div class="bdy90"> <%= image_tag "logo.gif", :class => "logostyle" %> <ul id="topnav"> <li> <a class="request" href="https://www.xyz.com"> <strong>Request Service</strong> </a> </li> <li> <a class="contact" href="https://www.xyz1.com">Contact Us</a> </li> </ul> </div> The wrinkle is that main.rhtml is a template. I''m trying to clone the look of my pages in my email... Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frank Vilhelmsen
2007-May-15 06:02 UTC
Re: How to include another rhtml from an rhtml (no controller)...
render :partial => "main.rhtml" 2007/5/15, Jason Vogel <jasonvogel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > I''m trying to do something simple like... > > In _email_header.rhtml > > <% include "header.rhtml" %> > > Where _header.rhtml looks like ... > > <div class="bdy90"> > <%= image_tag "logo.gif", :class => "logostyle" %> > > <ul id="topnav"> > <li> > <a class="request" href="https://www.xyz.com"> > <strong>Request Service</strong> > </a> > </li> > <li> > <a class="contact" href="https://www.xyz1.com">Contact Us</a> > </li> > </ul> > </div> > > The wrinkle is that main.rhtml is a template. > > I''m trying to clone the look of my pages in my email... > > Thanks, > Jason > > > > >-- Best Regards/Med Venlig Hilsen ------------------------------------- Frank Vilhelmsen Seniorkonsulent Cyber Com Consulting A/S mobil: +45 29483809 frank.vilhelmsen-SBS4hF7adkxbaj9gzE0k7wC/G2K4zDHf@public.gmane.org www.cybercomgroup.com/dk ------------------------------------- www.frankvilhelmsen.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frank Vilhelmsen
2007-May-15 06:05 UTC
Re: How to include another rhtml from an rhtml (no controller)...
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. # Renders the template located in [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. # Renders the template located at the absolute filesystem path render :file => "/path/to/some/template.rhtml" render :file => "c:/path/to/some/template.rhtml" # Renders a template within the current layout, and with a 404 status code render :file => "/path/to/some/template.rhtml", :layout => true, :status => 404 render :file => "c:/path/to/some/template.rhtml", :layout => true, :status => 404 # Renders a template relative to the template root and chooses the proper file extension render :file => "some/template", :use_full_path => true --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---