ruby-on-rails

Rails project, "Routing Error No route matches "/pages""


I folllowed this : http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup .

But when I try to access http://localhost:3000/pages/ it returns "Routing Error No route matches "/pages""

This is my routes.rb

Sample4App::Application.routes.draw do
  
    get "users/new"

    match '/signup',  :to => 'users#new'

    match '/contact', :to => 'pages#contact'
    match '/about',   :to => 'pages#about'
    match '/help',    :to => 'pages#help'

    match '/', :to => 'pages#home'
end

This is my home.html.erb

<h1>Sample App</h1>

<p>
  This is the home page for the
  <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
  sample application.
</p>

<%= link_to "Sign up now!", signup_path, :class => "signup_button round" %>

I tried everything I can.


Solution

  • It seems like your missing the actual route for '/pages/'. Try adding this to your routes.rb

    match '/pages' => 'pages#home'