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.
所以我在页脚布局中有一个简单的 link_to 标记,上面写着
<%= link_to "Home", root_path %>
此链接重定向到正确的页面,但在我刷新页面之前,输出显示为空白。刷新后,它会显示正确的输出。我的代码有问题吗?
只需清除浏览器数据并重新启动服务器即可。您可能还需要删除 public/index.html。
而是在根路径上写
<%= link_to "Home", 'home' %>
并在 pages_controller.rb
@title = "home"
这将重定向到您想要的输出