Hi, Being true to DRY, I know in Rails it is possible to define a single layout associated to a controller and all associated views, lists etc.. by the layout name taking on the name of the controller but is it possible of a layout to be shared between many controllers ? TIA, Tuka PS: I accidentally posted this in the Test forum.. so I moved it here to get a pertinent reply
on 2006-05-03 15:10
on 2006-05-03 15:15
Tuka O. wrote: > is it > possible of a layout to be shared between many controllers ? > Yes. Say your 'shared' layout is 'app/views/layouts/foo.rhtml', just do this at the top of your controller: class BarController < ApplicationController layout "foo"
on 2006-05-03 15:25
Cool !! Thanks, Tuka
on 2006-05-03 21:07
Hi Tuka, alternatively, you can call your default layout 'application.rhtml' - in this case you do not even need to specify it in application.rb. Cheers, Peter