简体   繁体   中英

How to work with tabbed signup/signin form using devise in rails

I am a new to the whole rails environment and learning to implement 'devise' gem for my project. Currently I have a tabbed signup/signin form.

在此处输入图片说明

I have generated the devise views and modified the /app/views/devise/sessions/new.html.erb to show this kind of tabbed form.Now functionality wise everything working fine. But there are several issues.

  1. When I am hitting http://localhost:3000/users/sign_up it still shows the devise old signup form. I want to show the same form with the Registration tab activated.
  2. On the Register tab if I submit the form with some error (Empty Email/Password), it is again redirecting to the default device registration form to show up the error messages.

I just want to get rid of this default registration page and want to use my Register tab for all signup purposes.

This question may sounds very basic, but I have no idea how to customize it. Please help.

Well, I like to make reference to the comment from @max as an answer, so that others could take that as an answer to this question.

I believe you are getting those errors because you are hacking your session views in Devise. The registration view in Devise is at /app/views/devise/registrations/new.html.erb . You have to refactor your code to do away with the errors.

Answer is courtesy of @max

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM