New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActionView 'form cannot contain nil' after rails 5 scaffold generation #24573
Comments
_A better trace_
|
Your error comes from the fact that This error is not surprising as an API controller shouldn't have the need to have a The confusing part is that the route |
Agree with @Edouard-chin -- it sounds like your Rails application should be a normal Rails app, not a special "API" application. Can you please provide a sample application that replicates the error you are seeing? The likely issue here is that |
Because the code generating routes check for @spastorino Do we want to support |
Should we rely on |
Allowing |
r? @spastorino |
…pi apps by default, to mimic behaviour from controllers. See also rails-api/rails-api@41f949f Fixes rails#24573
I think that supporting the I would simply remove the I'll test this approach and confirm it's a valid fix. |
It is fine to have |
@dhh 👍 |
+1. You all are correct. Looking back I get why the error happened. However it seems like views were created that really don't make sense in api mode (which leads to user confusion) |
Looks like this isn't blocking release candidate, though we would like to address it for final release. Removing milestone. |
@jeremy Unsure what that means? If it'd be blocking the final release, presumably it should be blocking the release candidate. |
@sgrif Means it's desirable for 5.0.0 release, but it's a high flux area without sufficient "real app" validation, so it's reasonable to address in 5.0.1 or 5.0.x along with the rest of the issues that 5.0.0 flushes out. Added 5.0.1 milestone to communicate this "if we can make 5.0.0, great, else 5.0.1" designation. |
Fixed in #27604 On main (note that
|
Steps to reproduce
rails g scaffold user email:uniq password:digest
rails g scaffold image --api name:string version:string cost:float public:bool memory:integer
rails g scaffold container --api name:string image_id:integer user_id:integer memory:integer
Expected behavior
Not error on image#new
Actual behavior
System configuration
Rails version: Rails 5.0.0.beta3
Ruby version: 2.3.0p0
The text was updated successfully, but these errors were encountered: