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.

resouces :only => :create broken since :shallow added

#4900

Hi guys,

When :shallow was added to the routes a day ago, :only => :create broke and no longer generates a helper method for use in your controllers/views.

Included is a failing test.

I would love to supply a patch, but need a pointer or two on where to look for the real cause of the issue.

Thanks,

Josh

Reported by Josh Kalderimis · June 18th, 2010 @ 03:28 PM

State: committed
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Josh Kalderimis
    Josh Kalderimis

    This issue is bigger than just create and includes update and destroy, I have a patch nearly finished which should cover all cases.

    June 18th, 2010 @ 03:52 PM

  2. Josh Kalderimis
    Josh Kalderimis

    Patch supplied with broader tests for :update, :destroy and :create helper methods not being generated when :shallow and :only or :except are used together.

    June 18th, 2010 @ 04:08 PM

  3. Andrew White
    Andrew White

    Nearly Josh, but you forget the lonely old singleton resource - good catch though.

    The attached patch is basically the same as yours - I just aliased collection_name on SingletonResource to member_name.

    June 18th, 2010 @ 04:27 PM

  4. Josh Kalderimis
    Josh Kalderimis

    Hi Andrew,

    Thanks for the feedback! :)

    Am I able to also get credited in this patch?

    Thanks,

    Josh

    June 18th, 2010 @ 04:33 PM

  5. Josh Kalderimis
    Josh Kalderimis

    Hi Andrew, (again)

    I see that your patch is minus tests for :only => :update and :delete, is your patch a replacement to mine, or are they to be used together?

    Thanks

    Josh

    June 18th, 2010 @ 04:36 PM

  6. Andrew White
    Andrew White

    Josh, by all means come up with a new patch with more extensive tests and then your patch can get applied and you'll get the credit.

    June 18th, 2010 @ 04:53 PM

  7. Josh Kalderimis
    Josh Kalderimis

    Updated patch with correction for singular routes and broader test coverage (again) :)

    June 18th, 2010 @ 05:28 PM

  8. Repository
    Repository
    • State changed from new to committed

    (from [9d3eeb905341aaad942ceb0e47bd04cced34d031]) fix for :shallow in router not generating helpers for create, update, and destroy actions when :only or :except are used

    [#4900 resouces :only => :create broken since :shallow added state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
    http://github.com/rails/rails/commit/9d3eeb905341aaad942ceb0e47bd04...

    June 18th, 2010 @ 10:03 PM

  9. José Valim