{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/23671","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/23671/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/23671/comments","events_url":"https://api.github.com/repos/rails/rails/issues/23671/events","html_url":"https://github.com/rails/rails/issues/23671","id":133504850,"number":23671,"title":"Rails 5 strong params giving unpermitted params on nested attributes index keys","user":{"login":"TrevorHinesley","id":1079481,"avatar_url":"https://avatars.githubusercontent.com/u/1079481?v=3","gravatar_id":"","url":"https://api.github.com/users/TrevorHinesley","html_url":"https://github.com/TrevorHinesley","followers_url":"https://api.github.com/users/TrevorHinesley/followers","following_url":"https://api.github.com/users/TrevorHinesley/following{/other_user}","gists_url":"https://api.github.com/users/TrevorHinesley/gists{/gist_id}","starred_url":"https://api.github.com/users/TrevorHinesley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrevorHinesley/subscriptions","organizations_url":"https://api.github.com/users/TrevorHinesley/orgs","repos_url":"https://api.github.com/users/TrevorHinesley/repos","events_url":"https://api.github.com/users/TrevorHinesley/events{/privacy}","received_events_url":"https://api.github.com/users/TrevorHinesley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/actionpack","name":"actionpack","color":"FFF700"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-14T04:32:35Z","updated_at":"2016-02-15T21:55:58Z","closed_at":null,"body":"This is Rails 5.0.0.beta2. For example:\r\n\r\n```\r\nparams.require(:song).permit(\r\n      song_audio_files_attributes: [\r\n        :id, :audio_file_id, :_destroy\r\n      ],\r\n      songwriters_attributes: [\r\n        :id, :writer_id, :percentage, :_destroy\r\n      ],\r\n      song_publishers_attributes: [\r\n        :id, :publisher_id, :percentage, :_destroy\r\n      ],\r\n      composers_attributes: [\r\n        :id, :artist_id, :_destroy\r\n      ],\r\n      playlist_songs_attributes: [\r\n        :id, :playlist_id, :_destroy\r\n      ],\r\n      taggable_tags_attributes: [\r\n        :id, :tag_id, :_destroy\r\n      ]\r\n    )\r\n```\r\n\r\nParams that are seen at the controller level:\r\n\r\n```\r\n{\r\n    \"song_audio_files_attributes\" => {\r\n        \"0\" => {\r\n            \"audio_file_id\" => \"56\",\r\n            \"_destroy\" => \"false\", \"id\" =>\r\n            \"13\"\r\n        }, \"1455422603597\" => {\r\n            \"audio_file_id\" => \"72\",\r\n            \"_destroy\" => \"false\"\r\n        }\r\n    }, \"songwriters_attributes\" => {\r\n        \"0\" => {\r\n            \"percentage\" => \"50.0\",\r\n            \"id\" => \"16\", \"writer_id\" =>\r\n            \"4\", \"_destroy\" => \"false\"\r\n        }\r\n    }, \"song_publishers_attributes\" => {\r\n        \"0\" => {\r\n            \"percentage\" => \"50.0\",\r\n            \"id\" => \"6\", \"publisher_id\" =>\r\n            \"7\", \"_destroy\" => \"false\"\r\n        }\r\n    }, \"playlist_songs_attributes\" => {\r\n        \"0\" => {\r\n            \"id\" => \"28\", \"playlist_id\" =>\r\n            \"9\", \"_destroy\" => \"false\"\r\n        }\r\n    }, \"taggable_tags_attributes\" => {\r\n        \"0\" => {\r\n            \"id\" => \"24\", \"tag_id\" =>\r\n            \"2\", \"_destroy\" => \"false\"\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nThe console shows:\r\n\r\n```\r\nUnpermitted parameters: 0, 1455422603597\r\n```\r\n\r\nWhy is this? All the other hashes work fine (those that only have one key, `\"0\"`), but it empties out the `song_audio_files_attributes` due to the two \"unpermitted\" parameters above. This is coming from Rails 4.2.5.1 which worked fine."},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/184411260","html_url":"https://github.com/rails/rails/issues/23671#issuecomment-184411260","issue_url":"https://api.github.com/repos/rails/rails/issues/23671","id":184411260,"user":{"login":"diego-silva","id":8826716,"avatar_url":"https://avatars.githubusercontent.com/u/8826716?v=3","gravatar_id":"","url":"https://api.github.com/users/diego-silva","html_url":"https://github.com/diego-silva","followers_url":"https://api.github.com/users/diego-silva/followers","following_url":"https://api.github.com/users/diego-silva/following{/other_user}","gists_url":"https://api.github.com/users/diego-silva/gists{/gist_id}","starred_url":"https://api.github.com/users/diego-silva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diego-silva/subscriptions","organizations_url":"https://api.github.com/users/diego-silva/orgs","repos_url":"https://api.github.com/users/diego-silva/repos","events_url":"https://api.github.com/users/diego-silva/events{/privacy}","received_events_url":"https://api.github.com/users/diego-silva/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T21:55:58Z","updated_at":"2016-02-15T21:55:58Z","body":"So I copied your sanitized_params function and the whole huge `song` param from your log and everything worked fine :confused: \r\n\r\n```\r\n=> Booting WEBrick\r\n=> Rails 5.0.0.beta2 application starting in development on http://localhost:3000\r\n=> Run `rails server -h` for more startup options\r\n=> Ctrl-C to shutdown server\r\n[2016-02-15 19:51:14] INFO  WEBrick 1.3.1\r\n[2016-02-15 19:51:14] INFO  ruby 2.2.2 (2015-04-13) [x86_64-darwin15]\r\n[2016-02-15 19:51:14] INFO  WEBrick::HTTPServer#start: pid=4890 port=3000\r\nStarted PATCH \"/test/index\" for ::1 at 2016-02-15 19:51:18 -0200\r\nProcessing by TestController#index as */*\r\n  Parameters: {\"song\"=>{\"song_audio_files_attributes\"=>{\"0\"=>{\"duration\"=>\"03:52\", \"has_vocals\"=>\"1\", \"full_length\"=>\"1\", \"watermarked\"=>\"0\", \"exclusions\"=>[\"\"], \"audio_file_id\"=>\"56\", \"_destroy\"=>\"false\", \"id\"=>\"13\"}, \"1\"=>{\"duration\"=>\"00:50\", \"has_vocals\"=>\"1\", \"full_length\"=>\"0\", \"watermarked\"=>\"0\", \"exclusions\"=>[\"\"], \"audio_file_id\"=>\"72\", \"_destroy\"=>\"false\", \"id\"=>\"14\"}, \"1455570064885\"=>{\"duration\"=>\"00:50\", \"has_vocals\"=>\"1\", \"full_length\"=>\"0\", \"watermarked\"=>\"0\", \"exclusions\"=>[\"\"], \"audio_file_id\"=>\"73\", \"_destroy\"=>\"false\"}}, \"title\"=>\"Breathing Loop\", \"song_artists_attributes\"=>{\"0\"=>{\"id\"=>\"12\", \"artist_id\"=>\"19\", \"_destroy\"=>\"false\"}}, \"album_songs_attributes\"=>{\"0\"=>{\"id\"=>\"12\", \"album_id\"=>\"3\", \"_destroy\"=>\"false\"}}, \"songwriters_attributes\"=>{\"0\"=>{\"percentage\"=>\"50.0\", \"id\"=>\"16\", \"writer_id\"=>\"4\", \"_destroy\"=>\"false\"}}, \"song_publishers_attributes\"=>{\"0\"=>{\"percentage\"=>\"50.0\", \"id\"=>\"6\", \"publisher_id\"=>\"7\", \"_destroy\"=>\"false\"}}, \"playlist_songs_attributes\"=>{\"0\"=>{\"id\"=>\"28\", \"playlist_id\"=>\"9\", \"_destroy\"=>\"false\"}}, \"taggable_tags_attributes\"=>{\"0\"=>{\"id\"=>\"24\", \"tag_id\"=>\"2\", \"_destroy\"=>\"false\"}}, \"notes\"=>\"Shit about shit\", \"licensable\"=>\"1\", \"tagging_completed\"=>\"1\", \"staff_pick\"=>\"1\"}, \"songwriters\"=>\"\", \"song_publishers\"=>\"\", \"composers\"=>\"\", \"playlist_songs\"=>\"\", \"mood_taggable_tags\"=>\"\", \"pace_taggable_tags\"=>\"\", \"genre_taggable_tags\"=>\"\", \"button\"=>\"\", \"id\"=>\"22\"}\r\nUnpermitted parameters: duration, has_vocals, full_length, watermarked, exclusions\r\nUnpermitted parameters: duration, has_vocals, full_length, watermarked, exclusions\r\nUnpermitted parameters: duration, has_vocals, full_length, watermarked, exclusions\r\nCompleted 200 OK in 5ms (Views: 0.3ms | ActiveRecord: 0.0ms)\r\n```\r\n\r\nUnless someone else can reproduce it or you make a reproducible script from the default templates [here](https://github.com/rails/rails/tree/master/guides/bug_report_templates) I don't see what else we can do..."}}