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 Editing Todo Lists

Kelcey Wilson
Kelcey Wilson
15,738 Points

dom_id method isn't working for me

Updated index.html.erb line 15 (below <tbody> to

<tr id="<% dom_id(todo_list) %>">

-- reloaded page & inspected element, but the todo_list items aren't numbered. Did the bin/rspec thing and got this error:

 Editing todo lists updates a todo list successfully with correct information
 Failure/Error: within "#todo_list_#{todo_list.id}" do
 Capybara::ElementNotFound:
   Unable to find css "#todo_list_2"

I've seen other questions about this issue, but those answers did not help me. Help?

Also -- in case this sheds any light -- I just did bin/rake spec to see what it'd say, and got this (excerpted):

MacBook-Pro-1:odot itadministrator$ bin/rake spec Running via Spring preloader in process 3658 /Users/itadministrator/.rbenv/versions/2.2.1/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb .FFFFF*..DEPRECATION WARNING: named_routes.helpers is deprecated, please use route_defined?(route_name) to see if a named route was defined. (called from block (4 levels) in <top (required)> at /Users/itadministrator/rails_training/odot/spec/controllers/todo_lists_controller_spec.rb:75) ........DEPRECATION WARNING: named_routes.helpers is deprecated, please use route_defined?(route_name) to see if a named route was defined. (called from block (3 levels) in <top (required)> at /Users/itadministrator/rails_training/odot/spec/controllers/todo_lists_controller_spec.rb:156) ..............*........F

Pending: TodoListsHelper add some examples to (or delete) /Users/itadministrator/rails_training/odot/spec/helpers/todo_lists_helper_spec.rb # No reason given # ./spec/helpers/todo_lists_helper_spec.rb:14 TodoList add some examples to (or delete) /Users/itadministrator/rails_training/odot/spec/models/todo_list_spec.rb # No reason given # ./spec/models/todo_list_spec.rb:4

Balint Bejczi
Balint Bejczi
3,375 Points

Hi, you didn't use the '=' sign when you're creating the id.

It should be:

<tr id="<%= dom_id(todo_list) %>">

I hope it can help!