계정 확인을 위해 Devise가 메일로 보내기 지시. 사용자가 확인 링크를 클릭하면 계정이 활성화되고 사용자가 static_pages#home
페이지로 리디렉션되지만이 링크를 다른 페이지로 리디렉션해야합니다.레일에서 confirmation_url을 변경하는 방법
확인 URL :
<p><%= link_to 'Подтвердить мой аккаунт', confirmation_url(@resource, confirmation_token: @token) %></p>
confirmation_controller :
/홈/블라드/데스크탑/MyApp를/응용 프로그램/컨트롤러/사용자/confirmations_controller : 브라우저에서
class Users::ConfirmationsController < Devise::ConfirmationsController # GET /resource/confirmation/new def new super end # POST /resource/confirmation def create super end # GET /resource/confirmation?confirmation_token=abcdef def show super end protected # The path used after resending confirmation instructions. def after_resending_confirmation_instructions_path_for(resource_name) super(resource_name) end # The path used after confirmation. def after_confirmation_path_for(resource_name, resource) new_profiles_path (resource_name, resource) end end
새로운 오류 .rb : 26 : 예기치 않은 ',', expecting ')'new_profiles_path (RESOURCE_NAME, 자원)^당신은
after_confirmation_path_for
당신이 그
app/controllers
에confirmations_controller.rb
를 작성하려면ConfirmationsController
에
after_confirmation_path_for
를 정의 할 필요가 있음을하려면 오버라이드 (override) 할 필요가 대신confirmation_url
을 변경할 필요가없는
입니다 /users/confirmations_controller.rb:26 : 구문 오류, 예기치 못한 ',', 예상 ')'new_profiles_path (resource_name, resource)^ –
이것은 현재 내 코드입니다 : protected def after_co nfirmation_path_for (resource_name, resource) new_profiles_path (resource_name, resource) end –
구문 오류가 발생했습니다. 질문에'confirmations_controller.rb'에 대한 코드 스 니펫을 붙여주세요. 코멘트에서 읽을 수없는 것 –