Remove Sign-up Ability [SOLVED]
Yeah, looks like you can just disable the registration routes and then manually add the edit registration ones.
https://stackoverflow.com/questions/39773890/how-to-remove-disable-sign-up-from-devise
https://stackoverflow.com/questions/39773890/how-to-remove-disable-sign-up-from-devise
# User account
devise_for :users,
controllers: {
masquerades: 'jumpstart/masquerades',
# omniauth_callbacks: 'users/omniauth_callbacks',
# registrations: 'users/registrations',
}
as :user do
get 'users/edit' => 'devise/registrations#edit', as: 'edit_user_registration'
put 'users' => 'devise/registrations#update', as: 'user_registration'
end...and...
# devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :confirmable, :invitable, :masqueradable, :omniauthable devise :database_authenticatable, :recoverable, :rememberable, :validatable, :confirmable, :invitable, :masqueradable
When I go to edit my profile it throws a validation error:
class Users::RegistrationsController < Devise::RegistrationsController
protected
def build_resource(hash = {})
self.resource = resource_class.new_with_session(hash, session)
# Jumpstart: Skip email confirmation on registration.
# Require confirmation when user changes their email only
self.resource.skip_confirmation!
end
def update_resource(resource, params)
# Jumpstart: Allow user to edit their profile without password
resource.update_without_password(params)
end
endI am guessing 'update_resource(resource, params)' is not overriding the default method now?
Notifications
You’re not receiving notifications from this thread.