重定向到的搜索结果同表错误
问题描述:
我想简单地重定向结果使用“表单标签”重定向到的搜索结果同表错误
<%= form_tag(request.original_url, method: ":GET") do %>
控制器的同一个动作这是我目前耙路线:
Prefix Verb URI Pattern Controller#Action
human_resources GET /human_resources(.:format) human_resources#index
human_resources_settings GET /human_resources/settings(.:format) human_resources/settings#index
human_resources_settings_constants GET /human_resources/settings/constants(.:format) human_resources/settings/constants#index
test_index GET /test(.:format) test#index
root GET / home#index
我越来越
No route matches [POST] "/human_resources/settings/constants"
我只是想重定向到备份设置/常数。该路线明显匹配"/human_resources/settings/constants(.:format)"
;重定向的目的是因为有搜索结果。我究竟做错了什么?
答
没有路由匹配[POST] “/ human_resources /设置/常量”
method: ":GET"
是错误的。下面的代码应该可以工作
<%= form_tag(request.original_url, method: :get) do %>