Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Change scaffolding to use respond_with

#3044

I've attached a patch which changes the generated scaffold controller to use the new and shiny respond_with syntax

Reported by Simon Jefford · August 12th, 2009 @ 08:47 PM

State: wontfix
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: none

Activity

  1. José Valim
    José Valim
    • 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.

    August 12th, 2009 @ 09:43 PM

  2. Simon Jefford
    Simon Jefford

    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.

    August 12th, 2009 @ 10:54 PM

  3. Simon Jefford
    Simon Jefford

    Here's a patch without inline assignment but with flash messages!

    August 13th, 2009 @ 10:50 AM

  4. José Valim
    José Valim
    • 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!

    August 30th, 2009 @ 03:27 PM

  5. trevor
    trevor

    any interest in including an alternate version of the scaffolding? one for learning, and one for best practices?

    February 8th, 2010 @ 10:14 PM

  6. Jeremy Kemper