# Scaffold problem

**URL:** <https://www.ruby-forum.com/t/scaffold-problem/92843>\
**Category:** Rails\
**Created:** [April 24, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/scaffold-problem/92843 "2007-04-24T22:59:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 24, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/1 "2007-04-24T22:59:24Z")

</div>

I thought I was _LONG_ past something like this, but I guess not.

I’m starting a new application. I created my database, one model  
(‘testimonials’ for the testimonial table), and an admin controller. To  
get a starting point, I added one line:

```
 scaffold :testimonials

```

When I try to open the admin controller (localhost:3000/admin), I get  
the following error:

uninitialized constant Testimonial

RAILS\_ROOT: script/…/config/…  
Application Trace | Framework Trace | Full Trace

This error occured while loading the following files:  
testimonial.rb

* * *

All I’ve done is add the scaffold line. Can someone suggest what might  
be wrong?

tia  
—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 25, 2007, 5:04am UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/2 "2007-04-25T05:04:44Z")

</div>

Rails pluralization still confuses me sometimes. The scaffold object  
should be singular like this:

scaffold :testimonial

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 25, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/3 "2007-04-25T17:15:31Z")

</div>

MenDAKE wrote:

> Rails pluralization still confuses me sometimes. The scaffold object  
> should be singular like this:
> 
> scaffold :testimonial

I’d thought of that (plurals get me, too ). “scaffold :testimonial”  
gets the same error.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 27, 2007, 4:48am UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/4 "2007-04-27T04:48:00Z")

</div>

In my case all names convetions are ok, and I am also getting the very  
same  
error.

The interesting thing is that if you create a static scaffold named  
“testimonial” using script\generate, then the controller on which  
“scaffold  
:testimonial” is defined will work fine. If you destroy the static  
scaffold,  
the you have the same error again.

I’m also looking for help on this.

Thanks

On 4/26/07, MenDAKE [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > gets the same error.
> 
> Hmmm… Could it be that your database table named “testimonial” instead  
> of “testimonials”? Table names must be plural.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Felipe Sodre S. Silva  
Engenharia de ComputaÃ§Ã£o - Universidade Estadual de Campinas  
+55 11 9604-1118  
removed\_email\_address@domain.invalid  
[http://www.students.ic.unicamp.br/~ra032714](http://www.students.ic.unicamp.br/~ra032714)

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 27, 2007, 4:27am UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/5 "2007-04-27T04:27:33Z")

</div>

Michael S. wrote:

> MenDAKE wrote:
> 
> > Rails pluralization still confuses me sometimes. The scaffold object  
> > should be singular like this:
> > 
> > scaffold :testimonial
> 
> I’d thought of that (plurals get me, too ). “scaffold :testimonial”  
> gets the same error.

Hmmm… Could it be that your database table named “testimonial” instead  
of “testimonials”? Table names must be plural.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [May 7, 2007, 3:09am UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/6 "2007-05-07T03:09:35Z")

</div>

Has anyone made any progress on this? I am having the same problem.

Thanks,

T

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [May 7, 2007, 3:29am UTC](https://www.ruby-forum.com/t/scaffold-problem/92843/7 "2007-05-07T03:29:11Z")

</div>

At risk of sounding like a broken record, are you absolutely sure the  
pluralization is correct in every instance? I just created exactly the  
same thing and it worked perfectly fine.

1. I created a table called “testimonials”. (Notice the plural.)

2. I generated a scaffold called “testimonial”. (Notice there is NO  
plural.)

3. I generated a controller called “admin”.

4. I added the line scaffold :testimonial to the admin controller  
(again, NO plural).

The above actions worked perfectly for me. I tried deviating the  
pluralization in some of the above steps and I received exactly the same  
error message. So if you’re sure you did all of the above then I believe  
I’ve hit the limit of my expertise in this area.
