Phoenix Rising
2011-Jul-09 05:09 UTC
Is it possible to use a site layout *without* a controller?
I''m in the process of doing some front-end design and planning, and the thought has occurred to me that I''d like to make use of the layouts in my Rails application for static assets. In other words, some one may go to example.com/stuff, and instead of bringing up a specific controller and action, I''d like it to simply render a straight-up HTML page *inside* the yield block of a given layout. Is there any way to do this without using a controller? It seems like a bit of a waste of space and resources to fire up a full controller stack just to have the benefit of static HTML and assets being rendered inside a layout''s yield block. Would Rails Metal be the only way to do this, or is there a simpler solution? Thanks for any information you can provide! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dheeraj Kumar
2011-Jul-09 05:19 UTC
Re: Is it possible to use a site layout *without* a controller?
If all you want is to render static HTML, I suggest using nanoc from nanoc.stoneship.org, and use thin to serve it, and Maybe nginx to act as a front. On Sat, Jul 9, 2011 at 10:39 AM, Phoenix Rising <polarisrising-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> I''m in the process of doing some front-end design and planning, and > the thought has occurred to me that I''d like to make use of the > layouts in my Rails application for static assets. In other words, > some one may go to example.com/stuff, and instead of bringing up a > specific controller and action, I''d like it to simply render a > straight-up HTML page *inside* the yield block of a given layout. > > Is there any way to do this without using a controller? It seems like > a bit of a waste of space and resources to fire up a full controller > stack just to have the benefit of static HTML and assets being > rendered inside a layout''s yield block. > > Would Rails Metal be the only way to do this, or is there a simpler > solution? Thanks for any information you can provide! > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.