From: Tom Stuart on
>    I *think* I could subclass Wx::Choice to something that stores the
> ID as well as the text to display, but I can see dragons in the distance
> that way....
>    What's my best option?

Caveat emptor... I don't know WxRuby at all. However, the
documentation (
mentions a method:

Integer append(String item, Object clientData)

item - String to add.
clientData - Client data to associate with the item.

and a corresponding:

Object get_item_data(Integer n)

n - The zero-based position of the item.

So would this work?

@choice =
Fruit.find(:all).each {|fruit| @choice.append(fruit,}

selected_fruit_id = @choice.get_item_data(@choice.get_selection)
fred = Person.create(:name => "Fred", :fruit_id => selected_fruit_id)