Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:59:07+00:00 2026-05-22T23:59:07+00:00

I have been having this issue for a while now and I cannot seem

  • 0

I have been having this issue for a while now and I cannot seem to wrap my brain around as I have recreated everything from scratch numerous times

Anyways I am at the part of the book where we want the home page link to go from http://localhost:3000/pages/home (This worked perfectly by the way) to http://localhost:3000
(basically meaning I want the home page to show up on the root page)

Currently the error i have is
LayoutLinks should have a Home page at ‘/’
Failure/Error: response.should have_selector(‘title’, :content => “Home”)
And underneath it is a bunch of text saying waht the page should look like.

Now I did 2 things, I first created the layout_links_spec.rb page, added the help page to the pages_controller.rb, and added the routes to config/routes.rb below is the code for all 3

layout_links_spec.rb

require 'spec_helper'
describe "LayoutLinks" do
#  describe "GET /layout_links" do
#    it "works! (now write some real specs)" do
  # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
#      get layout_links_index_path
#      response.status.should be(200)

it "should have a Home page at '/'" do
get '/'
response.should have_selector('title', :content => "Home")
     end

it "should have a Contact page at '/contact'" do
get '/about'
response.should have_selector('title', :content => "About")
end

it "should have a Help page '/help'" do
get '/help'
response.should have_selector('title', :content => "Help")
  end
end

Pages_controller.rb

def home
    @title = "Home"
  end

  def contact
        @title = "Contact"
  end

  def about
        @title = "About"
  end

  def help
        @title =  "Help"
  end 
end

config/routes.rb

SampleApp::Application.routes.draw do
match '/contact', :to => 'pages#contact'
match '/about',   :to => 'pages#about'
match '/help',    :to => 'pages#help'
root :to => 'pages#home'
end

Is there something I am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:59:07+00:00Added an answer on May 22, 2026 at 11:59 pm

    Add “end” to the end of your routes.rb 🙂
    There is a block, that opens with “do” and you didn’t close it. Check the listing 5.20 carefully.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a really weird problem that I have been having. When I download
I have been trying to tackle this problem , but I am having difficulty
I have been having some issues with LINQ-To-SQL around memory usage. I'm using it
I have been having an issue with Visual Studio 2010 that is driving me
I want to describe an issue I have been having with Plot using With
I have been having some problems trying to get my PHP running. When I
I have to compute at libraries quite often these days, and have been having
I have been creating Unit tests like crazy and find that I'm often having
I having trouble in dividing the HTML frames. I have been using the following
Have been looking at the MVC storefront and see that IQueryable is returned from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.