Wizard support for multiple models #10

Open
aquam8 opened this Issue Jan 14, 2010 · 2 comments

Projects

None yet

3 participants

@aquam8
aquam8 commented Jan 14, 2010

Hi Jeff,

It's a great piece of work, well done. I am trying to understand if i can use it for my needs which include creating a bunch of objects (different models) in a wizard (e.g. creating an equipment, one or more machines, hardwares). I currently have this working using nested forms in a single big form basically (and a lot of ajax), but i would like to simplify the process using a wizard like yours.

Is this supported (don't think so)? Any idea on how to do it?

Thanks / Matt

@midwire
midwire commented Jan 26, 2010

I am also interested in using multiple models. Please keep me informed if there is a way to accomplish that.

@michaelgpearce

Try using a tableless wizard model with columns defined that will delegate to the real model objects. Then add a validation that checks the delegated models for errors and copies them to the wizard model. Also override the create_or_update to instead do the create/update to delegate to your actual model objects. This pattern worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment