{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/shopify_app/issues/133","labels_url":"https://api.github.com/repos/Shopify/shopify_app/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/shopify_app/issues/133/comments","events_url":"https://api.github.com/repos/Shopify/shopify_app/issues/133/events","html_url":"https://github.com/Shopify/shopify_app/pull/133","id":76113171,"number":133,"title":"draw routes on the app - no need to mount use the routes boolean","user":{"login":"kevinhughes27","id":1965489,"avatar_url":"https://avatars.githubusercontent.com/u/1965489?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinhughes27","html_url":"https://github.com/kevinhughes27","followers_url":"https://api.github.com/users/kevinhughes27/followers","following_url":"https://api.github.com/users/kevinhughes27/following{/other_user}","gists_url":"https://api.github.com/users/kevinhughes27/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinhughes27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinhughes27/subscriptions","organizations_url":"https://api.github.com/users/kevinhughes27/orgs","repos_url":"https://api.github.com/users/kevinhughes27/repos","events_url":"https://api.github.com/users/kevinhughes27/events{/privacy}","received_events_url":"https://api.github.com/users/kevinhughes27/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-13T20:27:36Z","updated_at":"2015-05-14T18:42:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Shopify/shopify_app/pulls/133","html_url":"https://github.com/Shopify/shopify_app/pull/133","diff_url":"https://github.com/Shopify/shopify_app/pull/133.diff","patch_url":"https://github.com/Shopify/shopify_app/pull/133.patch"},"body":"closes #129 \r\n\r\nCurrently the routes are drawn on the engine and guarded by a config setting. The idea behind the config setting is that if you want the routes they appear naturally and not mounted at some location. For some rails engine it makes sense to mount the whole thing somewhere but this is more of an offloading to the engine type situation where it should be seamless. It was my mistake when doing the upgrade and still learning about engines.\r\n\r\nHowever since everyone had to mass upgrade recently the extra work required to get the routes was beneficial and safer. I still think that actually using the routes provided by the gem will be an atypical use case as most will run the global generator which disables and copies over the routes (and most people will want their own session controller with some extra things).\r\n\r\nI'll version bump after this one to keep things super safe for 6.0.5.\r\n\r\nfor review @celsodantas @stephenminded "},"comment":{"url":"https://api.github.com/repos/Shopify/shopify_app/issues/comments/102132107","html_url":"https://github.com/Shopify/shopify_app/pull/133#issuecomment-102132107","issue_url":"https://api.github.com/repos/Shopify/shopify_app/issues/133","id":102132107,"user":{"login":"kevinhughes27","id":1965489,"avatar_url":"https://avatars.githubusercontent.com/u/1965489?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinhughes27","html_url":"https://github.com/kevinhughes27","followers_url":"https://api.github.com/users/kevinhughes27/followers","following_url":"https://api.github.com/users/kevinhughes27/following{/other_user}","gists_url":"https://api.github.com/users/kevinhughes27/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinhughes27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinhughes27/subscriptions","organizations_url":"https://api.github.com/users/kevinhughes27/orgs","repos_url":"https://api.github.com/users/kevinhughes27/repos","events_url":"https://api.github.com/users/kevinhughes27/events{/privacy}","received_events_url":"https://api.github.com/users/kevinhughes27/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T18:42:52Z","updated_at":"2015-05-14T18:42:52Z","body":"Okay I go this working with mounting the Rails engine now. Heres the lo down:\r\n\r\n1. The engine needs to be mounted explicitly in the routes file for the routes to affect the host app. Thus simply adding the gem does nothing.\r\n\r\n2. The install generator adds the `mount` line to the host app routes file\r\n\r\n3. Routes generator (and therefore the global generator) copies the routes into the host app routes file and removes the mount line\r\n\r\n4. Testing mountable engines is weird - here is what I came up with which I think is the best. The dummy app has the routes explicitly copied (not mounted) this is because Rails testing can't handle the mounted routes and the host app routes at the same time and things get weird. However this leaves us with no tests testing that the engine mounts as expected - this is where my routes tests come in. In the routes test file I set the routes to the engine routes and ensure they route to the right spot. Maybe this will get better in a future version of rails but there is no shortage of people with this problem on the interwb (http://stackoverflow.com/questions/26820691/rails-4-engine-controller-redirect-fails-unit-testing,  http://stackoverflow.com/questions/7691594/how-to-test-routes-in-a-rails-3-1-mountable-engine, http://stackoverflow.com/questions/21294260/rails-engine-4-0-2-routing-methods-fail-in-controllers-using-minitest, http://stackoverflow.com/questions/22924752/no-route-matches-rails-engine)\r\n\r\nanother look please!"}}