Okay, here's yet another newbie question.

I'm creating an application with several linked tables-for example, Authors and Books. The "Book" model has its own primary ID (automatically generated), plus the following fields:

author_id
title
subtitle
subject

The author_id field is a foreign key linking it to the Authors table.

I want to create a static scaffold form so that I can generate new books. The "author_id" field does not show up in the scaffold, and it won't accept the field.

ULTIMATELY, I want this field to be a pull-down menu that allows me to select an author name and it goes back to a hash in the book model to pull the values (and automatically inserts the correct author_id).

I've tried creating just a plain text field in the static scaffold form:

<p><label for="author_id">Name</label><br/>
<%= text_field 'book', 'author_id'  %></p>

I've also tried form.select and various hashes, but the issue seems to be that I can't access the field (Book.author_id) from the scaffold.

What gives?

Thanks,

Kevin Burk
--
***************************************
BURK DESIGN GROUP
http://www.BurkDesignGroup.com
mailto:[EMAIL PROTECTED]
6161 El Cajon Blvd #306
San Diego, CA 92115
PHONE (619) 583-2311
FAX (619) 583-5801
***************************************
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to