Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails, One Model, Many Screens

I have a model with many fields (nearly 40). The client wants the fields divided among multiple screens. The model also has a few has_manys that should look like they are part of the same model.

How can one divide the model, and what are the tradeoffs among the ways to do it?

I see a couple of possibilities:

1) Use JavaScript to show and hide parts of the form. I think I can make that one work.

2) Use forms that submit to different actions. Can form_for be used with appropriate options?

I'm looking for other ideas too.

like image 230
Chris Avatar asked Feb 05 '26 14:02

Chris


1 Answers

Check out acts as state machine. You can use this to create wizards and whatnot.

Having reread your question, I think Javascript is really what you're looking for. Check out jQuery UI, they've got a tab component that will probably help.

like image 159
Tim Sullivan Avatar answered Feb 08 '26 14:02

Tim Sullivan