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.
I recently came across an issue where I had to check if a path existed given an array of possible paths. I had tried the above suggestion Rails.application.routes.recognize_path
, but it's depericated as of rails 4.2.1
. I used the following instead:
Rails.application.routes.named_routes.routes.any?{ |key, value| key.to_s === "new_article" }