Forum: Ruby on Rails One layout for entire apps

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2eac5554aeb88694468a955a0db2b274?d=identicon&s=25 Joshua Partogi (Guest)
on 2008-12-28 13:41
(Received via mailing list)
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
26a81e5badb9e002ab9ed3542036e584?d=identicon&s=25 Michael Libby (Guest)
on 2008-12-28 13:52
(Received via mailing list)
On Sun, Dec 28, 2008 at 6:40 AM, Joshua Partogi <joshua.java@gmail.com>
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

http://guides.rubyonrails.org/layouts_and_rendering.html

Section 2.2.12


--
Michael C. Libby
www.mikelibby.com
A82ba1167f4d4a8d1de63820e576a87f?d=identicon&s=25 Robby Russell (Guest)
on 2008-12-28 17:28
(Received via mailing list)
On Sun, Dec 28, 2008 at 4:40 AM, Joshua Partogi <joshua.java@gmail.com>
wrote:
>
> 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!

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]
2eac5554aeb88694468a955a0db2b274?d=identicon&s=25 Joshua Partogi (Guest)
on 2008-12-29 12:33
(Received via mailing list)
Thank you all for the responses. I'm going to try it out first.

Cheers
79ad5a1770c5cf086735a10ef7db6598?d=identicon&s=25 zero0x (Guest)
on 2008-12-29 13:11
(Received via mailing list)
You can also change the layout by calling layout 'layout' from the
controller class.

Joshua Partogi napĂ­sal(a):
This topic is locked and can not be replied to.