{"action":"opened","issue":{"url":"https://api.github.com/repos/NavigatingCancer/roles_on_routes/issues/5","repository_url":"https://api.github.com/repos/NavigatingCancer/roles_on_routes","labels_url":"https://api.github.com/repos/NavigatingCancer/roles_on_routes/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/NavigatingCancer/roles_on_routes/issues/5/comments","events_url":"https://api.github.com/repos/NavigatingCancer/roles_on_routes/issues/5/events","html_url":"https://github.com/NavigatingCancer/roles_on_routes/issues/5","id":155599244,"number":5,"title":"Internal call to 'route_set.recognize_path' fails with multiple mounted engines ","user":{"login":"domaindrivendev","id":1434343,"avatar_url":"https://avatars.githubusercontent.com/u/1434343?v=3","gravatar_id":"","url":"https://api.github.com/users/domaindrivendev","html_url":"https://github.com/domaindrivendev","followers_url":"https://api.github.com/users/domaindrivendev/followers","following_url":"https://api.github.com/users/domaindrivendev/following{/other_user}","gists_url":"https://api.github.com/users/domaindrivendev/gists{/gist_id}","starred_url":"https://api.github.com/users/domaindrivendev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domaindrivendev/subscriptions","organizations_url":"https://api.github.com/users/domaindrivendev/orgs","repos_url":"https://api.github.com/users/domaindrivendev/repos","events_url":"https://api.github.com/users/domaindrivendev/events{/privacy}","received_events_url":"https://api.github.com/users/domaindrivendev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-18T20:54:45Z","updated_at":"2016-05-18T20:54:45Z","closed_at":null,"body":"Consider the following application routes ...\r\n\r\n  ```ruby\r\n  Rails.application.routes.draw do\r\n    mount CareManagement::Engine => '/care'\r\n    mount CarePlanning::Engine => '/care_planning'\r\n  end\r\n  ```\r\n\r\nIf you try to access a \"roles_on_routes protected\" route in the CarePlanning engine e.g. \"GET /care_planning/resources\", then roles_on_routes throws the following error:\r\n\r\nActionController::RoutingError (No route matches \"/care_planning/resources\"):\r\n  actionpack (3.2.22.2) lib/action_dispatch/routing/route_set.rb:642:in `recognize_path'\r\n  /opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/roles_on_routes-b502875b3d89/lib/roles_on_routes/engine_aware_route_set.rb:31:in `recognize_path'\r\n\r\nHOWEVER ..........\r\n\r\nIf you switch the order of mounts in _routes.rb_, then it appears to work without any problems\r\n\r\n  ```ruby\r\n  Rails.application.routes.draw do\r\n    mount CareManagement::Engine => '/care'\r\n    mount CarePlanning::Engine => '/care_planning'\r\n  end\r\n  ```\r\n\r\nSo, it looks like both mounts starting with the same text (e.g. '/care') is causing the problem. Weird!"}}