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 Deleting Todo Items

Brian Patterson
Brian Patterson
19,588 Points

Please can someone help

Please can someone help me with the error I am getting.

1) Deleting todo items is successful
     Failure/Error: click_link "Delete"
     ActionController::RoutingError:
       No route matches [DELETE] "/todo_lists/1/todo_items/1/edit"
     # ./spec/features/todo_items/delete_spec.rb:17:in `block (3 levels) in <top (required)>'
     # ./spec/features/todo_items/delete_spec.rb:16:in `block (2 levels) in <top (required)>'

Where do I start to debug this. How can I correct this.

6 Answers

Brian Patterson
Brian Patterson
19,588 Points

Thanks Steve for your help. I have managed to sort this out.

That was proper cold, yes! Brrrr! But being hauled around by 4 large dogs made it a little warmer than it might have been. :+1:

Well done fixing the issue; what was it?

Hi Brian,

Is your project in a remote Github repository?

You've got a bad route so your controller isn't working quite right, or routes aren't defined.

There's also an issue with the view you're on. Your delete route looks like it is called from the edit link. Github will help, else I'll get more specific with my thoughts.

Steve.

Do your other routes work?

Brian Patterson
Brian Patterson
19,588 Points

Remind me how can I check that?

If you get no errors when navigating the page. Routes get you to the right bit of your page.

For example, the current test that is failing is saying that you are unable to delete a todo_item. It is saying there's no route to the delete result.

I'll do this in the morning. I need to punt the dogs out for a wee and then I need sleep.

Steve.

Brian Patterson
Brian Patterson
19,588 Points

No problem! It's cold out there wrap up! Thanks for your help.

Brian Patterson
Brian Patterson
19,588 Points

My index.html.erb in todoitems was wrong. Someone noticed this on Stackoverflow. Thought I would spread my net out wide.