rails / jbuilder

Jbuilder: generate JSON objects with a Builder-style DSL
MIT License
4.34k stars 440 forks source link

Add missing ':see_other' status code in generated destroy controller method #538

Closed ldeld closed 2 months ago

ldeld commented 2 years ago

See https://github.com/rails/rails/pull/45383

When scaffolding a model (with rails g scaffold ModelName), the destroy method in the generated controller is missing a 302 status code. Adding this status code is recommended in the Getting Started guide, so it makes sense to add it to the generated controller as well (especially since the not having the status code can cause issues when using a turbo link with data-turbo-method='delete')

ldeld commented 2 years ago

Tests failed for rails_head, but I don't believe those failures are related to this PR (the errors also happen when running tests from the main branch)