I'm sure this is a relatively simple question, and there must be a good sensible rails way of doing it, but I'm not sure what it is.
Basically I'm adding books to a database, and I want to store the Author in a separate table. So I have a table called authors which is referenced by the table books.
I want to create a rails form for adding a book, and I'd like it to be just a simple form for Author, Title, Publisher etc, and if it finds the author already in the authors table then it should just reference that record, and if it isn't in the authors table then it should add a new record and reference it.
I'm sure there's an easy way of doing this in rails - but I can't seem to find it.
Cheers,
Robin