开发者

route same url to different controllers based on method in RoR

开发者 https://www.devze.com 2023-01-16 02:05 出处:网络
i\'m trying to have the following structure get/something/id/apply => controller 1 post /something/id/apply => controller 2

i'm trying to have the following structure

get  /something/id/apply => controller 1
post /something/id/apply => controller 2

is there an easy way to accomplish this in rails 2.x? right now i'm resorting to manually checking the http method in the contro开发者_如何学Goller code, and that seems... fugly.


  map.match '/something/:id/apply', :method => :get, :controller => 'controller1'
  map.match '/something/:id/apply', :method => :post, :controller => 'controller2'
0

精彩评论

暂无评论...
验证码 换一张
取 消