Topic: creating an edit form that saves info to multiple tables...
I am working on making a todo list application as a way to learn rails. I already have set up two tables (todos and details) that are linked by a foreign key todo_id in the details table.
Currently the user can create a new todo item on the main page that creates the title(description in the db) for the item.
There is an edit button associated with each todo item. The detail for each item is stored in the details table (I only retrieve it if/when it is asked for and display it in a div using ajax - I already coded this).
I am using belongs_to :todo in the detail model and had_one :detail in the todo model.
I am at a loss as to how to use these to show any detail that already exists for the todo item in the edit form or how to update that detail when the edit form is submitted.
Basically it comes down to not completely comprehending has_one, belongs_to. So if you can help here or point me to a good resource that would be greatly appreciated!