Reputation: 30424
I am implementing a form in rails that is too big (about 60 fields). I would like to split this form into separate sections/pages.
What is the best approach to do this in rails?
Should the record be created in the database when user clicks 'Next' on the first page and from that page onwards the information in the database is updated?
Should I have different controllers for each page of the form?
The user should also be able to log-off before finishing the form and be able to start from the page they left off
Finally, is there a rails plugin/gem that will split a huge form into separate pages?
Upvotes: 1
Views: 647
Reputation: 40277
This Railscast on MultiStep forms is easy to implement and is rails 3 ready. You have one controller that renders different partials based on what step of your entry process you're on.
If you're in rails 2.3 (or ruby 1.8.7), I've seen people have success with https://github.com/jeffp/wizardly and https://github.com/adkron/actsaswizard
I recommend the multistep approach.
Upvotes: 1