Thank you for the replies-I don't think I'm being clear about the core problem, though.

I have no need for anything more flexible than the scaffold for this-it's an admin-only data entry form. I'm also very new at this, so abstract advice and code snippets don't help me because I have no context for them.

What I need is simply this:

A form that writes to the BOOKS table that includes an integer field for "author_id" (or simply "author" - see below). I can pretty it up with a select field of author names later. The BASIC function of the form still doesn't work.

The problem DOES seem to be with the _id extension of the field. When I rebuild the table and rename the field "author" instead of "author_id" the field shows up correctly in the scaffold form.

HOWEVER, now, I can't write to the table because I get an error of "Association TypeMismatch" in the BooksController: Author expected, got String

I think the issue is that the text field for "author" is not sending as an integer, which is what the "author" field in the database is. Actually, I'm sure of this, because in the session dump the request parameters show:

"author" => "1" when it SHOULD show "author" => 1

How can I fix this?
--
***************************************
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