![]() |
1
5
我只是使用了路线全局搜索来实现这一点:
请注意,此路由应位于routes.rb的末尾,以便所有其他路由在其之前匹配。 |
![]() |
2
0
您可以使用以下方法来处理常见位置的错误。将此代码放入ApplicationController def rescue_404 @message = "Page not Found" render :template => "shared/error", :layout => "standard", :status => "404" end def rescue_action_in_public(exception) case exception when CustomNotFoundError, ::ActionController::UnknownAction then #render_with_layout "shared/error404", 404, "standard" render :template => "shared/error404", :layout => "standard", :status => "404" else @message = exception render :template => "shared/error", :layout => "standard", :status => "500" end end 修改它以满足您的需要,您也可以有重定向。 高温高压 |
![]() |
Maddison · 如果用户选择18岁以下,则需要表单重定向用户 2 年前 |
![]() |
subash web · Iam在django中重定向模板时传递值 2 年前 |
![]() |
Joesph Stah Lynn · 反应窗口的版本。地方替换()? 2 年前 |
![]() |
P S · 在laravel 5.5中输入不起作用时重定向回 6 年前 |
![]() |
kebie · Django:如果url是由用户手动写入的,则重定向 6 年前 |
![]() |
Ashy Ashcsi · Reactjs从操作重定向 6 年前 |
![]() |
Tonye Boro · 用户注销后未重新搜索回上次访问的页面 6 年前 |
![]() |
Pavel Nedev · 表单提交时的PHP重定向无效 6 年前 |