Layouts are processed after the view, so anything you set in the view can be later accessed by the layout. Both the view and layout are rendered in the context of the controller instance where render was called, so a convenient method for sharing data between view and layout is to use instance variables, e.g @page_title.
I'm typing this in bed on my phone, but hopefully that can point you in the right direction in the mean time.
Cheers,
Tom