重定向到搜索结果的相同表单会出错
Redirecting to Same Form for Search Results makes Error
我正在尝试使用 "form tag"
将结果简单地重定向到控制器的相同操作
<%= 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"
我只是想重定向到后面 settings/constants。路线明显匹配 "/human_resources/settings/constants(.:format)"
;重定向的目的是因为有搜索结果。我做错了什么?
No route matches [POST] "/human_resources/settings/constants"
method: ":GET"
是错误的。下面的代码应该可以工作
<%= form_tag(request.original_url, method: :get) do %>
我正在尝试使用 "form tag"
将结果简单地重定向到控制器的相同操作<%= 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"
我只是想重定向到后面 settings/constants。路线明显匹配 "/human_resources/settings/constants(.:format)"
;重定向的目的是因为有搜索结果。我做错了什么?
No route matches [POST] "/human_resources/settings/constants"
method: ":GET"
是错误的。下面的代码应该可以工作
<%= form_tag(request.original_url, method: :get) do %>