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.

[Patch] --skip-helper for controller tests

#3011

patch attached

Generally, I like to make my helpers domain specific and I don't always have a need for them when I generate my controllers. It ultimately results in a lot of cruft in my app/helpers directory

This --skip-helper will omit the helper and the helper test from the files that are generated.

Arguably, I'd like to make this the default, but I realize that might be a little dramatic.

Reported by Dan Pickett · August 8th, 2009 @ 07:11 PM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. José Valim
    José Valim

    Already working on Rails 3.0. You can try to convince some from core to get them applied on Rails 2.3. :)

    August 8th, 2009 @ 07:21 PM

  2. Josh Nichols
    Josh Nichols

    +1, because if I usually immediately delete the generated helper.

    August 8th, 2009 @ 08:03 PM

  3. Dan Croak
    Dan Croak

    -1

    While I agree on not producing helpers, I write my own generators to override things like this.

    I say: "use a custom generator or wait until Rails 3.0." This doesn't need to be in Rails 2.3.

    August 8th, 2009 @ 08:12 PM

  4. Josh Nichols
    Josh Nichols

    Verified the patch works as expected.

    August 8th, 2009 @ 08:26 PM

  5. Steve St. Martin
    Steve St. Martin

    -1 I usually delete helpers as well, however I think this feature can wait till 3.0 as this is a change in behavior and not really a bug (is there a possibility this might break anyones custom generators?).

    August 8th, 2009 @ 08:31 PM

  6. AmundS
    AmundS

    +1 helpers usually sit empty, more often than not I don't need them.

    August 9th, 2009 @ 01:33 AM

  7. Dmitry Ratnikov
    Dmitry Ratnikov

    +1 since helpers are usually empty and in the event that you do want to generate them, should have also generated a corresponding helper unit test. That is currently not done anyway.

    August 9th, 2009 @ 04:23 AM

  8. Rizwan Reza
    Rizwan Reza

    verified

    +1 patch applies cleanly on 2-3-stable.

    August 9th, 2009 @ 04:36 AM

  9. Derander
    Derander

    +1 verified on 2-3-stable.

    This is a simple change that won't break anything to make some people's lives better on 2.3.

    August 9th, 2009 @ 09:20 PM

  10. Elad Meidar
    Elad Meidar

    +1 Verified on 2-3-stable, tested manually as well.

    good to know generators are getting smarter on 3.0

    August 9th, 2009 @ 10:05 PM

  11. Jeremy Kemper
    Jeremy Kemper
    • Tag changed from 2.3.x, bugmash to 2.3.x
    • State changed from new to wontfix

    I'd rather not pile on more options. How often are you even going to remember to provide it? Deleting the file is simple enough.

    August 10th, 2009 @ 06:51 AM