Dear all, I am still new in rails, and I realised that in rails each model has its own layout/template located under layouts/ Now my question is, is it possible to have only one layout for the entire apps instead of having separate one for each model? If so, is there any guide I can read about it? Or could someone give me a hint on how to do it Thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sun, Dec 28, 2008 at 6:40 AM, Joshua Partogi <joshua.java-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Dear all, > > I am still new in rails, and I realised that in rails each model has > its own layout/template located under layouts/ > > Now my question is, is it possible to have only one layout for the > entire apps instead of having separate one for each model? If so, is > there any guide I can read about it? Or could someone give me a hint > on how to do ithttp://guides.rubyonrails.org/layouts_and_rendering.html Section 2.2.12 -- Michael C. Libby www.mikelibby.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 -~----------~----~----~----~------~----~------~--~---
On Sun, Dec 28, 2008 at 4:40 AM, Joshua Partogi <joshua.java-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Dear all, > > I am still new in rails, and I realised that in rails each model has > its own layout/template located under layouts/ > > Now my question is, is it possible to have only one layout for the > entire apps instead of having separate one for each model? If so, is > there any guide I can read about it? Or could someone give me a hint > on how to do it > > Thanks in advanceJoshua, By default, Ruby on Rails will attempt to render the following layout view. * /app/views/layouts/application.html.erb This would match the ApplicationController naming. Good luck! Cheers, Robby -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting http://www.planetargon.com/ http://www.robbyonrails.com/ aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank you all for the responses. I''m going to try it out first. Cheers On Dec 29, 3:27 am, "Robby Russell" <ro...-/Lcn8Y7Ot69QmPsQ1CNsNQ@public.gmane.org> wrote:> On Sun, Dec 28, 2008 at 4:40 AM, Joshua Partogi <joshua.j...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Dear all, > > > I am still new in rails, and I realised that in rails each model has > > its own layout/template located under layouts/ > > > Now my question is, is it possible to have only one layout for the > > entire apps instead of having separate one for each model? If so, is > > there any guide I can read about it? Or could someone give me a hint > > on how to do it > > > Thanks in advance > > Joshua, > > By default, Ruby on Rails will attempt to render the following layout view. > > * /app/views/layouts/application.html.erb > > This would match the ApplicationController naming. > > Good luck!--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can also change the layout by calling layout ''layout'' from the controller class. Joshua Partogi napísal(a):> Dear all, > > I am still new in rails, and I realised that in rails each model has > its own layout/template located under layouts/ > > Now my question is, is it possible to have only one layout for the > entire apps instead of having separate one for each model? If so, is > there any guide I can read about it? Or could someone give me a hint > on how to do it > > Thanks in advance--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---