I am using the auto_complete functionality

<%= text_field_with_auto_complete :category, :name ... %>

after the user select an item , I need to get the ID of the selected item (category[:id]), is there any way to do it ? so I could give a value to a hidden field in my form, using the :after_update OR should I get it later with a Category.find_by_name (which will add another DB request...)

thanks for your suggestions


Have a look at model_auto_completer: