This project is archived and is in readonly mode.
Change scaffolding to use respond_with
Reported by Simon Jefford | August 12th, 2009 @ 08:47 PM | in 3.0.2
I've attached a patch which changes the generated scaffold controller to use the new and shiny respond_with syntax
Comments and changes to this ticket
-
José Valim August 12th, 2009 @ 09:43 PM
- Assigned user set to José Valim
- Milestone cleared.
Hey Simon,
Nice patch. I'm still not sure if we are going to change it or not, but a few things I noticed in your patch:
1) It removes flash messages. So scaffold tests will fail after your change (flash messages should be kept);
2) I don't like the inline syntax very much. It's cleaner with one line for assignment and another to invoke respond_with.
-
Simon Jefford August 12th, 2009 @ 10:54 PM
José,
Yes, you're absolutely right of course. Guess I got carried away with deleting code and missed that I was taking the flash messages out.
I'll get an updated patch attached tomorrow.
-
Simon Jefford August 13th, 2009 @ 10:50 AM
Here's a patch without inline assignment but with flash messages!
-
José Valim August 30th, 2009 @ 03:27 PM
- State changed from new to wontfix
Simon, after some discussion, we agreed that scaffold should be a learning tool. In this case, respond_with hides a lot of what is happening. For this reason, we won't change scaffold for respond_with. But thanks for working on a patch!
-
trevor February 8th, 2010 @ 10:14 PM
any interest in including an alternate version of the scaffolding? one for learning, and one for best practices?
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3888 scaffold generator upgraded to use responder and i18n See ticket #3044 for reference
- 3885 suggestion - generated scaffolding should be refactored to use respond_with See ticket #3044 for reference