# NoMethodError in new scaffold

**URL:** <https://www.ruby-forum.com/t/nomethoderror-in-new-scaffold/51203>\
**Category:** Rails\
**Created:** [December 27, 2005, 11:25pm UTC](https://www.ruby-forum.com/t/nomethoderror-in-new-scaffold/51203 "2005-12-27T23:25:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Leo](https://www.ruby-forum.com/u/Leo)\
**Post date:** [December 27, 2005, 11:25pm UTC](https://www.ruby-forum.com/t/nomethoderror-in-new-scaffold/51203/1 "2005-12-27T23:25:18Z")

</div>

Hi All,  
I created a new rails application using rails 1.0. I used “ruby  
script\generate scaffold” for each of my tables. This worked on all but  
2 of my tables. When I go to the new or edit action of my requests or  
admins table, I get the error below.  
On one table called admins I hadn’t followed the correct naming  
convention and wasn’t able to edit or create records. However, once I  
modified the table and re-created the scaffold it worked. However,  
I’ve double checked my naming conventions on my requests table and can’t  
figure this out. I also cannot find the line “\<%=h  
@request.parameters[“controller”].capitalize if” in any files. I’ve  
searched the mailing list and google and found many similar issues but I  
don’t see this particular issue or any answers. Any help would be  
appreciated.  
thanks,  
Leo

Here’s the error I’m getting  
NoMethodError in Requests#new

Showing  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/templates/rescues/template\_error.rhtml  
where line #3 raised:

undefined method `parameters’ for #Request:0x393ab60

Extracted source (around line #3):

1:

# 2: \<%=h @exception.original\_exception.class.to\_s %\> in 3: \<%=h @request.parameters[“controller”].capitalize if @request.parameters[“controller”]%\>#\<%=h @request.parameters[“action”] %\> 4:
  
5:  
6: 

Table Definition:

mysql\> desc requests;  
±-----------------±------------±-----±----±--------±---------------+  
| Field | Type | Null | Key | Default | Extra |  
±-----------------±------------±-----±----±--------±---------------+  
| id | int(11) | NO | PRI | NULL | auto\_increment |  
| problemsite\_id | int(11) | NO | | | |  
| project\_id | int(11) | NO | | | |  
| requesttype\_id | int(11) | NO | | | |  
| ostype\_id | int(11) | NO | | | |  
| requeststatus\_id | int(11) | NO | | | |  
| description | text | NO | | | |  
| actiontaken | text | YES | | NULL | |  
| admin\_id | int(11) | NO | | | |  
| wwid | varchar(8) | NO | | | |  
| idsid | varchar(8) | NO | | | |  
| name | varchar(50) | NO | | | |  
| email | varchar(50) | NO | | | |  
| phone | varchar(30) | NO | | | |  
| altphone | varchar(30) | YES | | NULL | |  
| badgecolor | varchar(2) | YES | | NULL | |  
| iscc | varchar(2) | NO | | | |  
| orgu | varchar(50) | NO | | | |  
±-----------------±------------±-----±----±--------±---------------+

---

<div class="post-metadata">

**Author:** ![Leo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Leo](https://www.ruby-forum.com/u/Leo)\
**Post date:** [December 27, 2005, 11:58pm UTC](https://www.ruby-forum.com/t/nomethoderror-in-new-scaffold/51203/2 "2005-12-27T23:58:44Z")

</div>

‘Request’ is a name that already belongs to Rails (handling the HTTP  
request from the user). It’s one of a semi-short list of things you  
can’t name your models or controllers.  
The easiest solution is to choose a different name for the model.  
Maybe something like UserRequest or CustomerRequest?

---

<div class="post-metadata">

**Author:** ![Leo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Leo](https://www.ruby-forum.com/u/Leo)\
**Post date:** [December 30, 2005, 8:14pm UTC](https://www.ruby-forum.com/t/nomethoderror-in-new-scaffold/51203/3 "2005-12-30T20:14:24Z")

</div>

Thank you very much! that worked! I’ve ordered the Agile Web  
Development with Rails book so hopefully I will not make these types of  
mistakes in the future 🙂

Wilson B. wrote:

> ‘Request’ is a name that already belongs to Rails (handling the HTTP  
> request from the user). It’s one of a semi-short list of things you  
> can’t name your models or controllers.  
> The easiest solution is to choose a different name for the model.  
> Maybe something like UserRequest or CustomerRequest?
