{"action":"created","issue":{"url":"https://api.github.com/repos/turbolinks/turbolinks/issues/169","repository_url":"https://api.github.com/repos/turbolinks/turbolinks","labels_url":"https://api.github.com/repos/turbolinks/turbolinks/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/turbolinks/turbolinks/issues/169/comments","events_url":"https://api.github.com/repos/turbolinks/turbolinks/issues/169/events","html_url":"https://github.com/turbolinks/turbolinks/issues/169","id":171780707,"number":169,"title":"Turbolinks don't update url after redirect(url) calling in rails routes.rb","user":{"login":"gambala","id":2563426,"avatar_url":"https://avatars.githubusercontent.com/u/2563426?v=3","gravatar_id":"","url":"https://api.github.com/users/gambala","html_url":"https://github.com/gambala","followers_url":"https://api.github.com/users/gambala/followers","following_url":"https://api.github.com/users/gambala/following{/other_user}","gists_url":"https://api.github.com/users/gambala/gists{/gist_id}","starred_url":"https://api.github.com/users/gambala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gambala/subscriptions","organizations_url":"https://api.github.com/users/gambala/orgs","repos_url":"https://api.github.com/users/gambala/repos","events_url":"https://api.github.com/users/gambala/events{/privacy}","received_events_url":"https://api.github.com/users/gambala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-17T22:59:55Z","updated_at":"2016-10-30T17:38:47Z","closed_at":null,"body":"Turbolinks gem is smart, and react to `redirect_to` rails method properly. But in rails we can also use redirect(url) method in routes.rb, like this:\r\n\r\n```\r\nRails.application.routes.draw do\r\n  namespace :account do\r\n    resources :ads\r\n    root to: redirect('account/ads')\r\n  end\r\nend\r\n```\r\n\r\nIf we go to the /account route with turbolinks turned on, we will see /account/ads index page, but url in browser (`window.location`) will be `/account`.\r\n\r\nTemporary (or permanent and proper?) solution - create, for example, `account/welcome_contoller.rb` with one liner index action: `redirect_to [:account, :ads]`, and replace `root to: redirect('account/ads')` in routes.rb by `root to: 'welcome#index'`.\r\n\r\nBut maybe turbolinks will learn how to react to redirect() method, won't it?"},"comment":{"url":"https://api.github.com/repos/turbolinks/turbolinks/issues/comments/257165610","html_url":"https://github.com/turbolinks/turbolinks/issues/169#issuecomment-257165610","issue_url":"https://api.github.com/repos/turbolinks/turbolinks/issues/169","id":257165610,"user":{"login":"javan","id":5355,"avatar_url":"https://avatars.githubusercontent.com/u/5355?v=3","gravatar_id":"","url":"https://api.github.com/users/javan","html_url":"https://github.com/javan","followers_url":"https://api.github.com/users/javan/followers","following_url":"https://api.github.com/users/javan/following{/other_user}","gists_url":"https://api.github.com/users/javan/gists{/gist_id}","starred_url":"https://api.github.com/users/javan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javan/subscriptions","organizations_url":"https://api.github.com/users/javan/orgs","repos_url":"https://api.github.com/users/javan/repos","events_url":"https://api.github.com/users/javan/events{/privacy}","received_events_url":"https://api.github.com/users/javan/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T17:38:47Z","updated_at":"2016-10-30T17:38:47Z","body":"If you're interested in investigating a fix, here's how the [turbolinks-rails] (https://github.com/turbolinks/turbolinks-rails) gem extends [`ActionController#redirect_to`](https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/redirecting.rb#L53-L60): https://github.com/turbolinks/turbolinks-rails/blob/master/lib/turbolinks/redirection.rb\r\n\r\nA similar extension would be needed for [`ActionDispatch::Routing#redirect`](https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/redirection.rb#L175-L187).\r\n\r\n"}}
{"actor":{"display_login":"javan"}}