Add new fields to Devise model. Rails 5
Customizing the RegistrationsController
class RegistrationsController < Devise::RegistrationsController
private
def sign_up_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation)
end
def account_update_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :current_password)
end
end
Now we need to tell Devise to use our registrations controller - we can do this in our config/routes.rb file.
devise_for :users, :controllers => { registrations: 'registrations' }