1
我有一个小问题,有栏杆里面调用的时候,我希望能够做这样的事情,以避免多重重定向:如何避免多个redirect_to的方法
def render_not_found
not_found
end
private
def not_found
redirect_to website_url(@website), :status => 301 and return return
end
return return
不起作用当然!
使用:导轨3.2.0
你为什么重定向到'website_url'之前,如果没有找到的东西?没有发现导致重定向发生的原因?请稍微解释一下你的逻辑,也许我们可以更好地帮助你。 – iwasrobbed 2012-01-27 22:38:13
在我的应用程序中随处调用not_found。 website_url(@website)只是主页。 – Hartator 2012-01-28 01:00:08