I have a selectbox that updates a given span area when a user selects a
value. The selectbox has the option :include_blank => true. The
controler will fetch the ID of the selected option in the combo box and
sends the description of the item with the same ID.
The problem is that the user is able to select the empty option, and the
controler will not be able to fecth the ID. This provides the error:
Couldn’t find Item with ID=
The id is blank, and this is why it shows the message.
The code of the controler is:
item = Item.find(@params[:id])
” + item.description + “”
I know I need to perform some kind of check on the @params[:id], but I
don’t know how to do it.
Thanks in advance,