Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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!