나는 내 웹 사이트에 사용자 등록 뷰와 모델을 만들기 위해 노력하고 있지만 작은 문제가 오전 : 페이스 북의 작동 기능을 연결 얻기 위해 내가 고안 사용하고고안와 페이스 북 사용자 정의 라우팅
및 omniauth을하고 그것을 작동 , 하지만 처음 페이스 북 사용자가 비밀번호를 만들 때 로그인을 원합니다. 그럴 수도 있습니다. 채워진 가입 양식으로 리디렉션되며 비밀번호 만 입력하면됩니다. 그러나 나는 그들에게 암호를 입력 할 수있는 /views/registrations/new_facebook.html.erb라는 두 번째 "sign_up 형식"으로 이동하기를 원합니다.
올바른보기를 만들었고 그것을 테스트하지만 얼마나 큰이 될 것이라고 누군가가 나를 도울 수 있다면 고안 기본에게 내가 그 인식되지 무슨 때문에 문제가 경기를 함께 생각
match '/facebook' => 'registrations#new', :as => 'new_facebook_user_registration'
,
을 우회 할 수있는 올바른 경로를 만드는 아무 생각이 없다 감사,
가 어떻게이 redirect_to의 new_facebook_user_registration_url가 실제로 작동 할 수
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def all
user = User.from_omniauth(request.env["omniauth.auth"])
if user.persisted?
flash[:success] = "Welcome back"
sign_in_and_redirect user
else
session["devise.user_attributes"] = user.attributes
redirect_to new_facebook_user_registration_url
end
end
alias_method :facebook, :all
끝 :3210 나는 omniauth 내 컨트롤러 코드를 추가?
OmniauthCallbacksController에서 new_user_registration_url이 아닌 다른 방법으로 어떻게 리디렉션 할 수 있습니까? new_facebook_registration_url을 말하십니까? 컨트롤러에서 한 경우에 리다이렉션을 사용하고 싶습니다. –