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

NameError in TodoListsController#index

so I was really working on odot project and I some how goofed. Now I am getting an error. NameError in TodoListsController#index

I am not sure what is causing this?

Thanks in advance

4 Answers

Looks like the name of ActiveRecord::Base is formatted incorrectly. you currently have: class TodoList < activerecord:: base, which is the incorrect name.

go to your TodoList model (todolist.rb?) under your app/models folder and replace the class name with this:

class TodoList < ActiveRecord::Base

and that should fix the problem.

can you copy and paste the the error?

``NameError in TodoListsController#index undefined local variable or methodactiverecord' for main:Object

Extracted source (around line #2): 1 2 3 4

class TodoList < activerecord:: base validates :title, presence: true end

Rails.root: /home/treehouse/projects/odot

Application Trace | Framework Trace | Full Trace app/models/todo_list.rb:2:in <top (required)>' app/controllers/todo_lists_controller.rb:7:inindex'

That fixed it! I do not remember changing it case? but hey I will take it.

I know the linux is case sensitive, but when should i be using caps in Ruby?