# How to handle no category on select element?

**URL:** <https://www.ruby-forum.com/t/how-to-handle-no-category-on-select-element/103659>\
**Category:** Rails\
**Created:** [May 8, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/how-to-handle-no-category-on-select-element/103659 "2007-05-08T23:48:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evensoul](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e9c0ed/32.png) [@evensoul](https://www.ruby-forum.com/u/evensoul)\
**Post date:** [May 8, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/how-to-handle-no-category-on-select-element/103659/1 "2007-05-08T23:48:15Z")

</div>

I have situation like this:

Assign: Choose category 1 category 2

So when I choose option ‘Choose’ with value 0 and I don’t have a  
category with that id i get error…

Making a new category in table with title = ‘No category’ doesn’t feel  
right

How can I handle that kind of problem?
