I’ve read a few posts and wikis discussing saving data from a form to 2 models.
My situation is that I want to collect a list of records from one model and use them to populate a form that will be saved to another model.
In other words, there will not be a relation between the models. I need to present a list (derived from model A) with some options - radiobutton, notes field and save all to model B. I will not be updating or linking back to model A whatsoever.
I am thinking that I should use Tabular input and use a simple SQL query to generate the list of items. How do I bind that list to a model attribute of model B though?
I am not sure if I completely understand what you want to achieve, but If you want to update only model B, I don’t see what is problem here. The only thing is that you need to pass two models to form, one that will be saved(model , and one that will be used to populate same data(drop-down options, radio buttons). And in post action, just save model B, as you would do same like when you use only one model in form.