[Rails] 'requests' is a bad table name

Thomas Werschlein werschlein at interlace.ch
Sat Feb 25 23:28:14 GMT 2006


... pretty obvious, isn't it? Because you end up with a Request model and
hence @request instance variables - and there you go: marvellous clash with
the controller environment that is established in instance variables ... such
as @request. After renaming my model to 'Inquiry' everything just worked fine.

Stupid as I am, that insight took me some time to figure out, so I thought I
could post a warning here. 

So that would mean that these are bad model/table names:
- Request/requests
- Param/params
- Cookie/cookies
- Response/responses
- Session/sessions (watch out you conference management coders ;-)
- Header/headers

I couldn't find any hints about reserved model names in the Rails book, but
only now found this wiki page:

http://wiki.rubyonrails.com/rails/pages/ReservedWords

Hope that helps others from struggling - and please correct if I am wrong

Thanks
Thomas



More information about the Rails mailing list