{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/24573","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/24573/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/24573/comments","events_url":"https://api.github.com/repos/rails/rails/issues/24573/events","html_url":"https://github.com/rails/rails/issues/24573","id":148811257,"number":24573,"title":"ActionView 'form cannot contain nil' after rails 5 scaffold generation","user":{"login":"kallisti5","id":100110,"avatar_url":"https://avatars.githubusercontent.com/u/100110?v=3","gravatar_id":"","url":"https://api.github.com/users/kallisti5","html_url":"https://github.com/kallisti5","followers_url":"https://api.github.com/users/kallisti5/followers","following_url":"https://api.github.com/users/kallisti5/following{/other_user}","gists_url":"https://api.github.com/users/kallisti5/gists{/gist_id}","starred_url":"https://api.github.com/users/kallisti5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kallisti5/subscriptions","organizations_url":"https://api.github.com/users/kallisti5/orgs","repos_url":"https://api.github.com/users/kallisti5/repos","events_url":"https://api.github.com/users/kallisti5/events{/privacy}","received_events_url":"https://api.github.com/users/kallisti5/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/actionview","name":"actionview","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-16T03:01:36Z","updated_at":"2016-04-18T08:31:20Z","closed_at":null,"body":"### Steps to reproduce\r\n\r\nrails g scaffold user email:uniq password:digest\r\nrails g scaffold image --api name:string version:string cost:float public:bool memory:integer\r\nrails g scaffold container --api name:string image_id:integer user_id:integer memory:integer\r\n\r\n### Expected behavior\r\nNot error on image#new\r\n\r\n### Actual behavior\r\n```\r\n_form.html.erb where line #1 raised:\r\n\r\nFirst argument in form cannot contain nil or be empty\r\nExtracted source (around line #1):\r\n\r\n<%= form_for(container) do |f| %>\r\n  <% if container.errors.any? %>\r\n    <div id=\"error_explanation\">\r\n      <h2><%= pluralize(container.errors.count, \"error\") %> prohibited this container from being saved:</h2>\r\n\r\n      <ul>\r\n\r\nTrace of template inclusion: app/views/containers/new.html.erb\r\n```\r\n\r\n\r\n### System configuration\r\n**Rails version**: Rails 5.0.0.beta3\r\n**Ruby version**: 2.3.0p0"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/211267658","html_url":"https://github.com/rails/rails/issues/24573#issuecomment-211267658","issue_url":"https://api.github.com/repos/rails/rails/issues/24573","id":211267658,"user":{"login":"prathamesh-sonpatki","id":621238,"avatar_url":"https://avatars.githubusercontent.com/u/621238?v=3","gravatar_id":"","url":"https://api.github.com/users/prathamesh-sonpatki","html_url":"https://github.com/prathamesh-sonpatki","followers_url":"https://api.github.com/users/prathamesh-sonpatki/followers","following_url":"https://api.github.com/users/prathamesh-sonpatki/following{/other_user}","gists_url":"https://api.github.com/users/prathamesh-sonpatki/gists{/gist_id}","starred_url":"https://api.github.com/users/prathamesh-sonpatki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prathamesh-sonpatki/subscriptions","organizations_url":"https://api.github.com/users/prathamesh-sonpatki/orgs","repos_url":"https://api.github.com/users/prathamesh-sonpatki/repos","events_url":"https://api.github.com/users/prathamesh-sonpatki/events{/privacy}","received_events_url":"https://api.github.com/users/prathamesh-sonpatki/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T08:31:20Z","updated_at":"2016-04-18T08:31:20Z","body":"> The confusing part is that the route new_container GET /containers/new and edit_container GET /containers/:id/edit should not be created as well as the associated views (edit, new, _form)\r\n\r\nBecause the code generating routes check for `config.api_only` and not to the command line options.\r\n\r\n@spastorino Do we want to support `--api` with generators? IMO it's a sideeffect as of now."}}