Splitting huge form in different sections in rails
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?
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.
精彩评论