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.

William Chung
14,915 PointsCouldn't find TodoList with 'id'=todo_list_id
When I click on link 'List Items', the following error is thrown:
ActiveRecord::RecordNotFound in TodoItemsController#index Couldn't find TodoList with 'id'=todo_list_id
and it complaining about this line: @todo_list = TodoList.find(params[:todo_list_id])
In the following code class TodoItemsController < ApplicationController def index @todo_list = TodoList.find(params[:todo_list_id]) end end
Thanks
1 Answer

Brandon Barrette
20,485 PointsSo I would go to that view where you are clicking the link. You have to pass the todo_list_id into the link, for example:
<%= link_to @todo_list.title, todo_list_path(@todo_list) %>
Notice I'm passing @todo_list into the todo_list_path. That adds the appropriate ID to the URL so that when the next page begins to load, it can fetch the ID and find the todo_list.
Hope that makes sense.
William Chung
14,915 PointsWilliam Chung
14,915 PointsBrilliant, thank you very much for your help.