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

Viewing Todo Item: par

I cannot pass the spec test because. The variable cannot find ":todo_list_id" and i dont know why!? can anyone help?

this is the error that i get :

1) Viewing todo items displays the title of the page Failure/Error: expect(page).to have_content("todo_list.title") expected to find text "todo_list.title" in "#<TodoList::ActiveRecord_Relation:0xa4c27dc>" # ./spec/features/todo_items/index_spec.rb:16:in block (3 levels) in <top (required)>' # ./spec/features/todo_items/index_spec.rb:15:inblock (2 levels) in <top (required)>'

and yes I have added this line into my todo_items controllers index definition:

@todo_list = TodoList.find(params[:todo_list_id])

2 Answers

I'm not sure if this should have the double quotes: have_content("todo_list.title"). Try removing them.

Hey Maciej, thx for your help. I figured it out. I did not do I proper relationship between my tables "todo_list" and "todo_items". Therefore every time I was trying to find the "todo_list_id" within the Todo_items#index page, it just couldn't because the relationship wasn't properly made.

Thank again your quick replies, greatly appreciated.