나는이 세 가지 궁리 :devise gem을 사용하여 특정 경로로 로그 아웃 할 수 없습니까?
내가application_controller.rb
def after_sign_in_path_for(authorize)
auth_main_path
end
def after_sign_out_path_for(authorize)
new_authorize_session_path
end
def after_sign_in_path_for(employe)
employee_emain_path
end
def after_sign_out_path_for(employe)
new_employe_session_path
end
def after_sign_in_path_for(hr)
hrs_hhome_path
end
def after_sign_out_path_for(hr)
new_hr_session_path
end
과 sign_out
버튼 application.html.erb
코드 :authorize
로 로그인하면
devise_for :hrs
devise_for :employes
devise_for :authorizes
이다 : 그것은 작동
<%= link_to "SIGNOUT", destroy_authorize_session_path, :method => :delete ,:data => { confirm: 'Are you sure?' } %>
여기까지 완벽하게,하지만 내가 컨트롤러를 추가하자마자 그녀의 두 유증은 오류를 내가 버튼으로 변경해야합니까
을 제공합니다 그래서 그것을 destroy the session for the current_session
내가 signed in
:hr
로, 다음 signout
클릭은 지정된 경로로 렌더링해야합니다. 다른 장치 모델에도 똑같이 적용해야합니다. 내가 sign_out
버튼을 누르면 전 직원 또는 시간으로 log_in 때
ERROR
나는 오류가 발생합니다. 나는 그것이`내가 해야하는 변화에 대한 employee_session을 파기해야한다.
감사합니다.
어떤 오류입니까? 질문에 답장 해주십시오. 로그 아웃이 작동합니까? –
예 현재 로그 아웃이 작동합니다. 하지만 나는 2 가지 이상을 가지고있다. –
오류가 발생했을 때 게시하십시오. –