2014-10-31 4 views
0

레일 : 어떤 이유로이 웹 페이지에 리디렉션 순환 오류가 있습니다 - 나는 그것이 오류가 발생했을 때 사용자 정의 경로로 리디렉션 내 애플 리케이션을 얻으려고

그러나 Twitter::Error::TooManyRequests

, 나는 데 어려움을

#app/controllers/tweets_controller.rb 

rescue_from Twitter::Error::TooManyRequests, with: :too_many_requests 

    def too_many_requests 

     redirect_to too_many_requests_path 

    end 
: 여기

This webpage has a redirect loop

내 컨트롤러 : 그리고 난이 오류가 계속

#config/routes.rb 

get "/too_many_requests", to: "tweets#too_many_requests", as: :too_many_requests 

나는 내가 잘못 일을해야 알 too_many_requests.html.erb

이름 app/views/tweets 내에서 전망을 가지고 있지만 누군가가 도움이 될 수 있습니다

여기 내 경로입니까? 내가 뭔가를 누락하지 않는 한

감사

+0

아마도 당신의'too_many_requests.html.erb' 그것에 트위터 피드를 어딘가에있다. –

+0

그게 내가 생각한 것이지만'too_many_requests.html.erb'은 현재 비어 있습니다. – Robbo

답변

3

, 그것은 당신이 자신에게 작업을 리디렉션과 같습니다

def too_many_requests 
    # Error handling..... 

    # You should redirect this elsewhere 
    redirect_to some_other_path 
end 
+0

doh! 네가 맞다, 어리석은 나를 보아 주셔서 고마워. – Robbo