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 Generate a Scaffold

Ali GULEZ
Ali GULEZ
2,500 Points

NoMethodError when generating scaffold with Rails 4.1.4.

I was following 'Generate a Scaffold' under 'Build a Todo List Application with Rails' and I have Ruby 2.1.2. and Rails 4.1.4. installed on my Mac. I have followed every step as shown in the video until typing 'bin/rails generate scaffold todo_list title:string description:text' in the console. When I do so I get the following error after 'spec/controllers/todos_controller_spec.rb' is created;

(erb):82:in template': undefined methodupdate_attributes' for #<Rails::Generators::ActiveModel:0x007fe79e5bc038> (NoMethodError)

I believe this is something to do with earlier version of Ruby and Rails used for this tutorial. Could someone please help me solve this issue? Many thanks.

Ali

2 Answers

Robert Ho
PLUS
Robert Ho
Courses Plus Student 11,383 Points

I'm not sure if this matters as much but in the video it shows that name of the file should be

'spec/controllers/todo_lists_controller_spec.rb' but you have 'spec/controllers/todos_controller_spec.rb', which means you are missing the word lists in the file name. Good luck!

I have the right name of the file, but the same problem... Please help if someone figured out what's the problem?