I am working through this tutorial -> http://ruby.railstutorial.org/chapters/filling-in-the-layout
You can experience the problem here -> intense-dusk-3202.herokuapp.com/
When I click on the “Home” link in the header it tries to take me to http://intense-dusk-3202.herokuapp.com/root_path instead of just http://intense-dusk-3202.herokuapp.com/
Here is my routes.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
Here is my app/views/layouts/_header.html.erb file:
<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>
Do you need to see anything else before you can help me?
You shouldn’t quote those helpers:
root_path,help_path, and all other named route helpers are actually ruby methods. Just call them directly, don’t put quotes around them.