Search code examples
ruby-on-railsrubyauthenticationdevise

Customizing Devise vs Creating own authentication for multi page registration


I'm creating a ruby on rails project (soon to be a mobile app). I wanted to utilize the Devise gem for authentication, but I am struggling with the customization of Devise. I wanted to implement a multi-page registration/sign up process. The standard devise gem automatically provides a form that includes email and password. For my project, I wanted the users to add in their name on one page, then their email on the next page, and then their password on the page after, etc. Please see the attached jpg picture for a super basic example.

So far, I separated the registration controller from the devise package. The registration controller comes with the new.html.erb and the edit.html.erb files. I want to take the standard form in the new.html.erb file and split that into multiple html.erb files. The controller would obviously need to be connected to these multiple files. As I was working on it, I realized how complicated it is. I'm wondering is it better to create my own authentication process instead of devise, or is it better to stick with devise?

I really want to make it work with devise, so if you have any suggestions on how to customize the gem to implement the multipage registration that I want, please let me know.


Solution

  • This can be done by modifying the views and the devise controller to accept multi-part registration, but it is cumbersome: I would counsel you to avoid it. Rather, another option would be to: (i) use devise to handle the email and username in one form and then (ii) handle the multi-part registration using the wicked gem - whose sole purpose for existence is to handle multi part registration problems.