Rails: Multi-Step New User Signup Form (FSM?)

吃可爱长大的小学妹 提交于 2019-12-20 10:10:43

问题


I've read the "Create Multi-Step Wizard" in Advanced Rails Recipes. I've also read and re-read the documentation for the updated FSM I'm using called Workflow, and looked here and here. The Advanced Rails Recipe focuses on records (quizzes) that already exist, and doesn't cover creating new ones. The Workflow docs don't cover any code for controllers or views, so I've no idea what to do with all this model magic, and the last two links barely touch on implementation either. From the aforementioned resources, I have a good understanding of what a FSM in Rails is and how to play with it in the console or IRB, but I've got very little direction or understanding how to implement one into my Rails app.

What I would like is this: a simple, multi-step user signup process.

Step 1: User enters in their critical details (with validations).

Step 2: User enters in their search criteria, for their profile (with validations).

Step 3: User agrees to the Terms of Service (with validations).

Step 4: User is greeted by a confirmation page, including a link that takes them to their newly created account.

I'd also like full navigation between the steps and full capture (saves to the database) with each transition.

Can someone please give me a clear implementation of something similar to this? I would LOVE an example app that includes a multi-step signup process where I can look at the code (FULL source code--models AND controllers and views) under the hood, but I've been unable to find anything like that.

Any guidance would be appreciated!

EDIT: Please help make this a Railscast! Ryan B. (a.k.a. Superman), if you're reading this, we need you! http://feedback.railscasts.com/forums/77-episode-suggestions/suggestions/35553-multi-step-forms-and-wizards


回答1:


Ryan B. has created a screencast for this http://railscasts.com/episodes/217-multistep-forms .

Cheers, Cristi



来源:https://stackoverflow.com/questions/2917604/rails-multi-step-new-user-signup-form-fsm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!