Determine if path exists as route in Rails controller

后端 未结 5 1973
离开以前
离开以前 2021-01-13 03:57

I want to know if an arbitrary path can be mapped to a route

recognized_request_for accomplishes what I want, but I can\'t get it to work in my controller.

5条回答
  •  北海茫月
    2021-01-13 04:23

    You could possibly dynamically generate the route helper method and see if it exists (using respond_to? or even just catching any thrown exception).

提交回复
热议问题