[code language=”ruby”]
class ApplicationController < ActionController::Base
layout :setlayout

def setlayout
if current_user && current_user.company?
‘dashboard’
else
‘application’
end
end
end
[/code]