On Mon, May 19, 2008 at 7:13 PM, Kad Kerforn
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
> 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...)
Have a look at model_auto_completer:
http://agilewebdevelopment.com/plugins/model_auto_completer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---