I am sure this is a relatively simple question and there should be a good reasonable rail, but I'm not sure what it is.
Basically, I add books to the database, and I want to save the Author in a separate table. Therefore, I have a table called authors, which is referenced by table books.
I want to create a rails form for adding a book, and I would like it to be a simple form for Author, Title, Publisher, etc., and if she finds the author already in the authors table, then he should just refer to this entry, and if it is not in the authors table, she must add a new entry and refer to it.
I am sure there is an easy way to do this on rails - but I cannot find it.
Greetings
Robin
source share