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

  • SEARCH
  • Home
  • 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 9052695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:14:30+00:00 2026-06-16T13:14:30+00:00

i am getting error when i test my app log of the error are

  • 0

i am getting error when i test my app log of the error are

1) Static pages Home page should have the h1 'Sample App'
     Failure/Error: visit root_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xa674fa8>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:5:in `block (3 levels) in <top (required)>'

  2) Static pages Home page should have the base title
     Failure/Error: visit root_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xa8eaf58>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:9:in `block (3 levels) in <top (required)>'

  3) Static pages Home page should not have a custom page title
     Failure/Error: visit root_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xb63d804>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:13:in `block (3 levels) in <top (required)>'

  4) Static pages Help page should have the h1 'Help'
     Failure/Error: visit help_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xa65f284>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:19:in `block (3 levels) in <top (required)>'

  5) Static pages Help page should have the title 'Help'
     Failure/Error: visit help_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xa56dcb8>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:23:in `block (3 levels) in <top (required)>'

  6) Static pages About page should have the h1 'About'
     Failure/Error: visit about_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xb839450>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:29:in `block (3 levels) in <top (required)>'

  7) Static pages About page should have the title 'About Us'
     Failure/Error: visit about_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xa65a464>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:33:in `block (3 levels) in <top (required)>'

  8) Static pages Contact page should have the h1 'Contact'
     Failure/Error: visit contact_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xa56d808>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:40:in `block (3 levels) in <top (required)>'

  9) Static pages Contact page should have the title 'Contact'
     Failure/Error: visit contact_path
     ActionView::Template::Error:
       undefined method `to' for #<#<Class:0xa66470c>:0xb835be8>
     # ./app/views/layouts/_header.html.erb:4:in `_app_views_layouts__header_html_erb___446387253_86947970'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__887388821_90453380'
     # ./spec/requests/static_pages_spec.rb:44:in `block (3 levels) in <top (required)>'

Finished in 0.45434 seconds
9 examples, 9 failures

Failed examples:

my routes.rb file is

Sample::Application.routes.draw do
 root to: 'static_pages#home'

match '/help', to: 'static_pages#help'
match '/contact', to: 'static_pages#contact'
match '/about' , to: 'static_pages#about'
  end

My _header.html.erb code is

<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%= link to "sample app", '#', id: "logo" %>

<nav>
<ul class="nav pull-right">
<li><%= link_to "Home",  '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</div>
</div>
</header>

and application.html.erb code is

<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= render 'layouts/shim' %>
</head>
<body>
<%= render 'layouts/header' %>
<div class="container">
<%= yield %>
<%= render 'layouts/footer' %>
</div>
</body>
</html>

can any one please help why i am getting this undefined to method error and how to get rid of it??

  • 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-06-16T13:14:31+00:00Added an answer on June 16, 2026 at 1:14 pm

    Probably you have a typo in _header file, because every error has it, check the _header file again and if this is the case same error you should get when you run rails server and try to access the pages.

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

Sidebar

Related Questions

I'm getting the following error on a simple test app I am working on
I have a iframe app. I am getting a alert that says -error in
I am getting this weird error while running cucumber test: ERROR Mongo::OperationFailure: Database command
I am getting the above error whenever I test on an emulator, but not
I am getting linking error when I try to compile a test code. I'm
My unit test keeps getting the following error: System.InvalidOperationException: The Connection is not open.
I am trying to test a app on my phone. I keep getting this
I keep getting the following error when trying to deploy my app with the
I'm trying to test my app on an iPhone 3G, however I'm getting this
I am working on an app and am getting a strange error. Two out

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.