Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试阅读 guides.rubyonrails 但我似乎无法弄清楚:
我的 rails 4.0 应用程序的 application.html.erb 文件中有一个刊头。我希望在除主页之外的所有页面中呈现标头 div。
谢谢你的帮助!
您可以将其包装在一个条件 ruby 语句中,例如
<% unless current_page?(root_url) %> <div>Your html code</div> <% end %>