我有一部分只有在某些页面使用该布局时我才想在布局中显示.我为所有页面设置了@page_title,并认为我可以使用这样的东西:
<% case @page_title when "Log in" || "Forgot Your Password" || "Create a New Password" %><%= render :partial => "common/hello-world" -%><% end -%>
Run Code Online (Sandbox Code Playgroud)
但是,包含仅发生在标题为"登录"的页面上,而不是其他页面.是|| Case开关上不允许这样的语句?是否有不同的方法在案例开关中设置OR语句?
谢谢!