harvey
harvey

Reputation: 299

Issue with my routes

I have the following error message when I load my app in the browser :

routes

I am not sure what I have missing here. The route for the home page is correctly defined.

The paths are defined as follows in the view :

<li><%= link_to "Home",   root_path %></li>
<li><%= link_to "Help",   help_path %></li>

and as follows in the routes file :

Rails.application.routes.draw do
  root                'static_pages#home'
  get 'help'   =>     'static_pages/help'
end

Any idea what I am missing here ?

Thanks !

Upvotes: 0

Views: 41

Answers (1)

dgilperez
dgilperez

Reputation: 10796

Your route is wrong. You need to rename your routes to change the slash for a "#", assuming help is a separate action in your static_pages_controller.rb, as well as for any other routes in your header (about, help, etc).

Rails.application.routes.draw do
  get 'help'   =>     'static_pages#help'
end

Upvotes: 1

Related Questions