我正在完成本教程-> http://ruby.railstutorial.org/chapters/filling-in-the-layout
你可以在这里遇到问题-> strong-dusk-3202.herokuapp.com/
当我单击标题中的“主页”链接时,它会尝试带我去,http://intense-dusk-3202.herokuapp.com/root_path
而不仅仅是http://intense-dusk-3202.herokuapp.com/
这是我的路线.rb
SampleApp::Application.routes.draw do
get "users/new"
root :to => 'static_pages#home'
match '/signup', to: 'users#new'
match '/help', to: 'static_pages#help'
match '/about', to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
end
这是我的 app/views/layouts/_header.html.erb 文件:
<header class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<%= link_to "sample app", 'root_path', id: "logo" %>
<nav>
<ul class="nav pull-right">
<li><%= link_to "Home", 'root_path' %></li>
<li><%= link_to "Help", 'help_path' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</div>
</div>
</header>
在你帮助我之前,你还需要看什么吗?