back to

Ruby on Rails To-do List

ARCHIVED

Archived: This project has been archived. Cards can no longer be completed.

Viewing Todo Items: Part 1

Stefy
Stefy completed this card.
Last updated
Generate todo-items controller:
bin/rails generate controller todo_items index

Create a directory to house our to-do item features:
spec/features/todo_items.
Make sure that we have an index spec as well:
touch spec/features/todo_items/index_spec.rb

Set up a todo_list to work with in these tests:

describe "Viewing todo items" do 	
it "displays no items when a todo list is empty"
	visit "/todo_lists"
end 
end


Make sure I can click a link inside of the to-do list and get this empty to-do items page.

In >routes, I'm going to have a nested resource for todo items. This will provide different routes to work with. 

When adding or changing routes, it's necessary to link it a little bit different. 

Run bin/rake routes to show all the paths in our app.

<%= link_to "List Items", todo_list_todo_items_path(todo_list) %>