{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/20610","labels_url":"https://api.github.com/repos/rails/rails/issues/20610/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/20610/comments","events_url":"https://api.github.com/repos/rails/rails/issues/20610/events","html_url":"https://github.com/rails/rails/issues/20610","id":89104665,"number":20610,"title":"Confusion around form_for defaults and json/js","user":{"login":"joallard","id":949482,"avatar_url":"https://avatars.githubusercontent.com/u/949482?v=3","gravatar_id":"","url":"https://api.github.com/users/joallard","html_url":"https://github.com/joallard","followers_url":"https://api.github.com/users/joallard/followers","following_url":"https://api.github.com/users/joallard/following{/other_user}","gists_url":"https://api.github.com/users/joallard/gists{/gist_id}","starred_url":"https://api.github.com/users/joallard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joallard/subscriptions","organizations_url":"https://api.github.com/users/joallard/orgs","repos_url":"https://api.github.com/users/joallard/repos","events_url":"https://api.github.com/users/joallard/events{/privacy}","received_events_url":"https://api.github.com/users/joallard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-17T19:32:48Z","updated_at":"2015-06-17T19:54:57Z","closed_at":"2015-06-17T19:44:07Z","body":"With Convention over configuration, you can usually trust the defaults to get you there. In this case, not so much. I've been banging my head on the wall for a few hours now, in between trying things and researching.\r\n\r\nFor the usual cases, how do I set up an AJAX form. Is it using JS or JSON format?\r\n\r\n**Case 1: `form_for remote: true` default, `format.js`**\r\n\r\nUJS sends a request as JS.  \r\nException: Missing template for update.js.\r\n\r\n`form_for remote: true, format: :json`\r\n\r\nNo difference in HTML output, though `form_for` doc examples says you can do that.\r\n\r\n**Case 2: `form_for remote: true, html: {\"data-type\" => :json}` not the default**\r\n\r\nResponder will answer 204, but why is this not default in either `form_for` or UJS?\r\n\r\nWhat is the expected use case and can it be documented? I suspect it's the latter, but I expected there to be good defaults in place."},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/112927626","html_url":"https://github.com/rails/rails/issues/20610#issuecomment-112927626","issue_url":"https://api.github.com/repos/rails/rails/issues/20610","id":112927626,"user":{"login":"joallard","id":949482,"avatar_url":"https://avatars.githubusercontent.com/u/949482?v=3","gravatar_id":"","url":"https://api.github.com/users/joallard","html_url":"https://github.com/joallard","followers_url":"https://api.github.com/users/joallard/followers","following_url":"https://api.github.com/users/joallard/following{/other_user}","gists_url":"https://api.github.com/users/joallard/gists{/gist_id}","starred_url":"https://api.github.com/users/joallard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joallard/subscriptions","organizations_url":"https://api.github.com/users/joallard/orgs","repos_url":"https://api.github.com/users/joallard/repos","events_url":"https://api.github.com/users/joallard/events{/privacy}","received_events_url":"https://api.github.com/users/joallard/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T19:54:57Z","updated_at":"2015-06-17T19:54:57Z","body":"Does the Google Groups UX count as an issue? "}}