我想通过Expected request URL
获取JSON结果。我怎么能这样做?
当前请求网址:
http://localhost:3000/research/demo/customer/12,13/history.json
预期请求网址
http://localhost:3000/research/demo/customer/history/12,13
当前路线:
namespace :research do
namespace :demo do
get 'customer/:items/history.json' => "customer#history"
end
end
答案 0 :(得分:0)
namespace :research do
namespace :demo do
get 'customer/history/*items' => "customer#history"
end
end
根据请求格式
,每个请求都呈现为html或json或xml