Autocomplete and database updates

I’m trying to figure out a way to have the rails3-auto-complete plugin
pull back a Name field in the text box but when saving to the database,
that it would only save a hidden id field and not the name (for database
normalization purposes). Here is my example

Category
id
name

Item
id
name
description
category_id

When I do the text field for autocomplete

I would only want the hidden value submitted and I don’t know what a
good approach or recommendation woudl be. I could denormalize the
database but I don’t want too and I could also put some of these
categories into just a standard file and read from them…but would like
to learn how to do this properly within Rails.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs