# Getting error Unknown method 'new' for a new model instance

**URL:** <https://www.ruby-forum.com/t/getting-error-unknown-method-new-for-a-new-model-instance/144331>\
**Category:** Rails\
**Created:** [July 28, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/getting-error-unknown-method-new-for-a-new-model-instance/144331 "2008-07-28T18:45:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 28, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/getting-error-unknown-method-new-for-a-new-model-instance/144331/1 "2008-07-28T18:45:41Z")

</div>

I have a model called Test. In the controller I have @circuit =  
Test.new. Any ideas why rails is complaining about the ‘new’ method??

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 28, 2008, 7:09pm UTC](https://www.ruby-forum.com/t/getting-error-unknown-method-new-for-a-new-model-instance/144331/2 "2008-07-28T19:09:41Z")

</div>

Test is a reserved word. It’s for a Unit test. Change your table and  
model  
name to something else, like Exam or something.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 28, 2008, 11:25pm UTC](https://www.ruby-forum.com/t/getting-error-unknown-method-new-for-a-new-model-instance/144331/3 "2008-07-28T23:25:43Z")

</div>

uggh. Thanks. I never do any ruby testing so I forgot about that.  
DOH!!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 28, 2008, 11:50pm UTC](https://www.ruby-forum.com/t/getting-error-unknown-method-new-for-a-new-model-instance/144331/4 "2008-07-28T23:50:55Z")

</div>

Shame on you 🙂
