0
我試圖讓我的應用程序重定向到一個自定義的路由時遇到錯誤:此網頁有重定向循環 - Rails的
Twitter::Error::TooManyRequests
不過,我有困難,出於某些原因我不斷收到此錯誤:
This webpage has a redirect loop
這裏是我的控制器:
#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
這裏是我的路線:
#config/routes.rb
get "/too_many_requests", to: "tweets#too_many_requests", as: :too_many_requests
我有一個名爲too_many_requests.html.erb
我知道我一定是不正確的做事內app/views/tweets
的視圖,但有人可以幫忙嗎?
感謝
想必你'too_many_requests.html.erb'上有你的Twitter飼料的地方。 – 2014-10-31 14:02:20
這就是我認爲,但'too_many_requests.html.erb'目前是空的 – Robbo 2014-10-31 14:13:00