I want to separate Devise's edit registration form into two separate pages, something like site/edit and site/settings. Settings page would be for fields like password, email, etc. while edit would just be for user information. How would I go about accomplishing this I haven't really found much documentation on this.
I've figured this one out on my own and I didn't have to create a separate model, trying to keep everything simple for future integration. I'll post my answer for anyone else who may run into this problem. Surprised there wasn't clearer documentation on this.
Create a separate RegistrationsController that inherits from Devise's generated controller:
class RegistrationsController < Devise::RegistrationsController
def settings
@member = current_member
if @member
render :settings
else
render file: 'public/404', status: 404, formats: [:html]
end
end
end
Create the corresponding view in your Devise registrations folder (I just copied the fields I needed from the existing edit form) and then call to the method in your routes:
devise_scope :member do
root :to => 'devise/registrations#new'
match '/settings' => 'registrations#settings', as: :settings
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With