# You have a nil object when you didn't expect it!

**URL:** <https://www.ruby-forum.com/t/you-have-a-nil-object-when-you-didnt-expect-it/91181>\
**Category:** Rails\
**Created:** [April 5, 2007, 12:39pm UTC](https://www.ruby-forum.com/t/you-have-a-nil-object-when-you-didnt-expect-it/91181 "2007-04-05T12:39:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonas](https://www.ruby-forum.com/u/jonas)\
**Post date:** [April 5, 2007, 12:39pm UTC](https://www.ruby-forum.com/t/you-have-a-nil-object-when-you-didnt-expect-it/91181/1 "2007-04-05T12:39:56Z")

</div>

I get the following error when I try to create a new item (create action  
for a controller).

You have a nil object when you didn’t expect it!  
The error occurred while evaluating nil.\<=

---

<div class="post-metadata">

**Author:** ![jonas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonas](https://www.ruby-forum.com/u/jonas)\
**Post date:** [April 5, 2007, 1:07pm UTC](https://www.ruby-forum.com/t/you-have-a-nil-object-when-you-didnt-expect-it/91181/2 "2007-04-05T13:07:35Z")

</div>

Jonas wrote:

> I get the following error when I try to create a new item (create action  
> for a controller).
> 
> You have a nil object when you didn’t expect it!  
> The error occurred while evaluating nil.\<=

Probably you attempt to use a nil (undefined) parameter.

Some rows of code could help us.
