Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created August 20, 2014 12:25
Show Gist options
  • Select an option

  • Save nicolasblanco/4e166d674adaa361b966 to your computer and use it in GitHub Desktop.

Select an option

Save nicolasblanco/4e166d674adaa361b966 to your computer and use it in GitHub Desktop.
class ParameterSanitizer < Devise::ParameterSanitizer
def sign_up
default_params.permit(:title, :first_name, :last_name, :email, :password, :password_confirmation, :address, :city_id, :office_phone_number, { speciality_ids: [] }, :terms_of_service)
end
end
class ApplicationController < ActionController::Base
def devise_parameter_sanitizer
case resource_class
when Doctor
Doctor::ParameterSanitizer.new(Doctor, :doctor, params)
else
super # Use the default one
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment