2011-09-29 3 views
2

페이스 북 인증과 함께 jQuery Mobile (자원 식별자를 많이 사용함)을 사용하는 프로젝트가 있습니다. 최근 Facebook은 콜백에 #_=_을 추가하기 시작했습니다 (here 참조). 이것은 jQuery Mobile을 죽이는 것입니다.레일즈 리다이렉트시 리소스 식별자 삭제

#_=_과 일치하는 모든 경로에 대해 자동 리디렉션을 수행 할 수 있습니까? 리디렉션 할 때 리소스 식별자 (#)를 지정할 수 있습니까? 다른 가능한 수정? 현재 자바 스크립트 리디렉션을 사용하고 있지만 중복 된 페이지로드 및 일부 분석 문제가 발생합니다. 페이스 북은 그것을 해결 될 때까지 다음과 같은 일에

답변

1

추가 주위 (작동하는 것 같다) :

# app/controllers/omniauth_controller.rb 

def create 
    ... 
    js_redirect_to(user_path) 
end 

private 

def js_redirect_to(path) 
    @location = path 
    render "shared/redirect" 
end 

# app/views/shared/redirect.html.haml 

:javascript 
    window.location = '#{@location}'