Padrino 0.13.2でのお話です。Padrinoは複数のアプリケーションをマウントして用いることができます。
#{Padrino.root}/config/apps.rb
# Mounts sub applications.
Padrino.mount('MyApp::SubApp0', :app_file => Padrino.root('subapp0/app.rb')).to('/subapp0')
Padrino.mount('MyApp::SubApp1', :app_file => Padrino.root('subapp1/app.rb')).to('/subapp1')
# Mounts the core application for this project
Padrino.mount('MyApp::App', :app_file => Padrino.root('app/app.rb')).to('/')
この時、夫々のアプリケーションのviewやlayoutは別々の名前空間に存在しますが、例えばadmin用途と一般ユーザ用途でよく似たviewを使いたいことがあります。その場合は、renderにオプション引数でviewとlayoutのパスを指定します。
#{Padrino.root}/subapp0/controllers/something.rb
get :index do
...
render "something/index", views: MyApp::App.view_path(""), layout: MyApp::SubApp0.layout_path(:application)
end
これでメインのアプリケーションの something/index.haml を、SubApp0のレイアウトを用いて描画することができます。ヘッダやフッタはSubAppの用途によって違うこともあるので、レイアウトも別途指定できるのは便利だと思います。