Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Viewing Todo Items: Part 1

Asa Smith
Asa Smith
10,009 Points

Unable to find link "List items"

Getting this error

1) Viewing todo items displays no items when the todo list is empty
     Failure/Error: click_link "List items"
     Capybara::ElementNotFound:
       Unable to find link "List items"
     # ./spec/features/todo_items/index_spec.rb:8:in `block (3 levels) in <top (required)>'
     # ./spec/features/todo_items/index_spec.rb:7:in `block (2 levels) in <top (required)>'
 <tbody>
    <% @todo_lists.each do |todo_list| %>
      <tr id="<%= dom_id(todo_list)%>">
        <td><%= todo_list.title %></td>
        <td><%= todo_list.description %></td>
        <td>

          <%=link_to "List Items", todo_list_todo_items_path(todo_list) %>
          <%= link_to 'Show', todo_list %></td>
          <%= link_to 'Edit', edit_todo_list_path(todo_list) %></td>
          <%= link_to 'Destroy', todo_list, method: :delete, data: { confirm: 'Are you sure?' } %>
        </td>
Rails.application.routes.draw do
   resources :todo_lists do
      resources :todo_items
    end
  root 'todo_lists#index'

3 Answers

Raymond Sapida
Raymond Sapida
33,049 Points

Hi there,

It looks like you need to edit your feature spec to capitalize the "i'" in "List items" and turn it to "List Items" so that it'll match this line of code:

<%=link_to "List Items", todo_list_todo_items_path(todo_list) %>
Raymond Sapida
Raymond Sapida
33,049 Points

You're welcome. My most frustrating errors usually comes down to something simple like that lol

Asa Smith
Asa Smith
10,009 Points

Gah. It was so simple. Thanks!