더 많은 매개 변수로 등록하고 더 많은 정보 (아직까지 행운은 없음)를 등록하기 위해 기기 등록 방법을 맞춤 설정하려고했지만 항상 Unpermitted parameters:
오류가 발생합니다. 이 Adding extra registration fields with Devise과 https://github.com/plataformatec/devise#strong-parameters을 사용해 보았습니다.등록을 위해 맞춤 매개 변수 추가하기 - 허용되지 않는 매개 변수
외래 키를 사용자 ID로 유지하고 거기에 user_id, display_name, profile_picture
과 같은 내용을 넣을 새 테이블을 만들려고했지만 동일한 페이지에서 모든 것을 제출하려고 할 때 같은 문제가 발생합니다. devise 컨트롤러).
해결 방법에 대한 의견이 있으십니까? 그 밖의 무엇을 게시해야합니까? 그냥 매개 변수를 허용해야하는 고안 말할 필요가 같은
routes.rb
devise_for :users, controllers: { registrations: 'users/registrations' }
사용자/regC는
def create
build_resource(registration_params)
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_up(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
respond_with resource, :location => after_sign_up_path_for(resource)
end
else
clean_up_passwords
respond_with resource
end
end
private
def registration_paramss
params.require(:user).permit(:email, :display_name, :terms_of_services, :profile, :password, :password_confirmation)
end
당신의 장치 구성을 게시하십시오. – 31piy
@ 31piy 업데이트 됨 –
어떤 장치 버전을 사용하고 있습니까? 재정의 된 컨트롤러 (사용자/등록)를 우리에게 보여줄 수 있습니까? 생성 작업 및 가입 매개 변수를 사용자 정의하는 부분. – gkats