{"action":"closed","issue":{"url":"https://api.github.com/repos/rails/rails/issues/27454","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/27454/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/27454/comments","events_url":"https://api.github.com/repos/rails/rails/issues/27454/events","html_url":"https://github.com/rails/rails/issues/27454","id":197514959,"number":27454,"title":"Not hidden routing default parameters","user":{"login":"benone","id":111381,"avatar_url":"https://avatars.githubusercontent.com/u/111381?v=3","gravatar_id":"","url":"https://api.github.com/users/benone","html_url":"https://github.com/benone","followers_url":"https://api.github.com/users/benone/followers","following_url":"https://api.github.com/users/benone/following{/other_user}","gists_url":"https://api.github.com/users/benone/gists{/gist_id}","starred_url":"https://api.github.com/users/benone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benone/subscriptions","organizations_url":"https://api.github.com/users/benone/orgs","repos_url":"https://api.github.com/users/benone/repos","events_url":"https://api.github.com/users/benone/events{/privacy}","received_events_url":"https://api.github.com/users/benone/received_events","type":"User","site_admin":false},"labels":[{"id":107189,"url":"https://api.github.com/repos/rails/rails/labels/actionpack","name":"actionpack","color":"FFF700","default":false},{"id":41328116,"url":"https://api.github.com/repos/rails/rails/labels/attached%20PR","name":"attached PR","color":"006b75","default":false},{"id":107186,"url":"https://api.github.com/repos/rails/rails/labels/regression","name":"regression","color":"e10c02","default":false},{"id":126910270,"url":"https://api.github.com/repos/rails/rails/labels/With%20reproduction%20steps","name":"With reproduction steps","color":"009800","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-25T20:58:35Z","updated_at":"2016-12-29T17:50:37Z","closed_at":"2016-12-29T17:50:37Z","body":"### Expected behavior\r\nRoute generator should hide parameter if it is equal to default.\r\n\r\n### Actual behavior\r\nRoute generator doesn't hide parameter\r\n\r\n>   get '(:param1)/test(/:param2)' => \"index#index\", \r\n     :defaults => {\r\n       :param1 => 1,\r\n       :param2 => 2\r\n    },\r\n     :constraints => {\r\n       :param1 => /\\d*/,\r\n       :param2 => /\\d+/\r\n     }\r\n\r\n> url_for(:controller => \"index\", :param1 => \"1\")\r\n => \"http://127.0.0.1:3000/1/test\"\r\n\r\n_(should be http://127.0.0.1:3000/test)_\r\n\r\n**BUT**\r\n> get '(:param1)/test' => \"index#index\", \r\n     :defaults => {\r\n      :param1 => 1\r\n    },\r\n    :constraints => {\r\n      :param1 => /\\d*/\r\n    }\r\n\r\n> url_for(:controller => \"index\", :param1 => \"1\")\r\n => \"http://127.0.0.1:3000/test\"\r\n\r\nI think here https://github.com/rails/rails/blob/v5.0.1/actionpack/lib/action_dispatch/journey/formatter.rb#L38 should be next instead of break\r\n\r\n### System configuration\r\n5.0.1\r\n\r\n**Ruby version**:\r\n2.3.3"}}
{"actor":{"display_login":"rafaelfranca"}}