Nested layouts

2 views
Skip to first unread message

Ashley Moran

unread,
Oct 27, 2009, 5:01:11 PM10/27/09
to ram...@googlegroups.com
Hi

I'm giving a more serious look at Ramaze now - only used it for simple
stuff before. I'd like a backup in case either Rails 3 takes forever,
and Merb gets stuck... or I just don't like Rails 3 and Merb dies.
Have to say I like what I've seen of Ramaze+Innate 2009.10.

One thing I can't find though - and I've googled for this and read the
Ramaze book, but I can't find anything relevant. Is it possible to
render nested layouts in Ramaze?

It's quite easy to do in Merb, using the following helper method:

# http://groups.google.com/group/merb/browse_thread/thread/03444f049caf924b
def parent_layout(layout, &block)
render capture(&block), :layout => layout
end

This lets you write layouts like the following (Haml):

= parent_layout "application" do

#banner
Blah blah blah

.sublayout
= catch_content :for_layout

I've had a quick go, but without digging into it I can't see an easy
way of doing it. My current efforts have turned into infinite loops.
Is this possible in Ramaze?

Cheers
Ashley

--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/

Reply all
Reply to author
Forward
0 new messages