Input text value retrieve id value

In the view, when add a new row to a join table (A
has_many :bs :through :zs). if one wishes to display and require the
name value instead of the id value in the form partial, what is the
correct procedure to follow?

The examples that I see usually provide a drop down selector that is
pre-populated but I require the ability to simply enter the name
value, return to the controller, look up the value, add the record if
it is ok or return an error if it is not. In the partial do I create
a local field and send that back or do I use the attribute