Rails routes matching query parameters

后端 未结 2 638
野趣味
野趣味 2021-01-12 09:21

Rails routes are great for matching RESTful style \'/\' separated bits of a URL, but can I match query parameters in a map.connect config. I wa

2条回答
  •  不要未来只要你来
    2021-01-12 09:35

    Unless there is a concrete reason why you can't change this, why not just make it restful?

    map.connect "api/my/path/bananas/:id, :controller => "bananas_controller", :action => "my_action"

    If you have many parameters, why not use a POST or a PUT so that your parameters don't need to be exposed by the url?

提交回复
热议问题