Camping Technique -- Multiple Layouts
John Beppu
john.beppu at gmail.com
Tue May 27 00:24:35 EDT 2008
Hey Campers,
Here's a little technique you can use to support multiple layouts within a
Camping app.
def layout
@layout ||= 'default'
send("#{@layout}_layout") { yield }
end
The minimum you have to do after this is define a *default_layout*, but (as
you can hopefully see) you may define any number of arbitrary layouts to
wrap your content in.
Just set *@layout* in your controllers, and when it comes time to render a
view, be sure a layout w/ the name "#{@layout}_layout" exists.
--beppu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/camping-list/attachments/20080526/419861f2/attachment.html>
More information about the Camping-list
mailing list