header.clearfix{:role => "banner"}
%h1.logo
%span.company> Cerner
Care
%h2.application-name Welcome to the BigData application suite!
%ul.button-bar
%li
%a{:href => "Logout"} Log Out
%li
%a{:href => "http://www.google.com", :target => "_blank"} Help
%span.username
-unless current_user.nil?
#{current_user.display_name}
%header.context.clearfix{:role => "banner"}
%nav.navigation-bar.clearfix{:role => "navigation"}
%h3.reader-details Account Management Tools
%a.home{:href => root_path, :role => "link", :title => "Home"}Home
%em
%a{:href => "dsonboarding/index", :role => "link"} Data Source Onboarding
%a{:href => "otherapp/index", :role => "link"} Some Other Application
我想在显示用户名之前验证用户名是否为空,而 haml 给我上述代码的语法错误。如果我做错了什么,请告诉我?