Displaying 1 result from an estimated 1 matches for "display_item_descript".
2006 Jul 04
1
Select Box problem in the controler with Ajax
...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:
def display_item_description
item = Item.find(@params[:id])
render_text "<p>" + item.description + "</p>"
end
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,
Gama Franco
--
Posted via http://www.ruby-fo...