我在routes.rb
中有这个get 'search#search', to: 'search#search', as: 'search'
如果我rails routes
,则返回以下内容:
search GET /search%23search(.:format) search#search
我想将/search%23search
更改为search/search
我该怎么做?
答案 0 :(得分:2)
在rails中你写为:
get 'search/search', to: 'search#search', as: 'search'
这将导致:
search GET /search/search(:format) search#search