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.

Fixed polymorphic_url to be able to handle singleton resources.

#461

The polymorphic_url helper does not handle singleton resources correctly. This patch allows you to specify singular resources by listing them as symbols (much like namespaces).

Example usage:

polymorphic_url([:admin, @user, :blog, @post]) # =>  admin_user_blog_post_url(@user, @post)

The attached patch was generated from the github fork.

Reported by Tammer Saleh · June 20th, 2008 @ 08:40 PM

State: resolved
Milestone: 2.1.1
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Tammer Saleh
  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 2.1.1
    • Assigned user set to Jeremy Kemper
    • State changed from new to open

    June 20th, 2008 @ 09:16 PM

  3. Tammer Saleh
    Tammer Saleh
    • Assigned user cleared.

    New patch that improves documentation and removes accidentally included comments.

    June 20th, 2008 @ 09:17 PM

  4. Tammer Saleh
    Tammer Saleh
    • Assigned user set to Jeremy Kemper

    June 20th, 2008 @ 09:43 PM

  5. Mike Burns
    Mike Burns

    +1, would make my life much easier.

    June 20th, 2008 @ 09:54 PM

  6. Tammer Saleh
    Tammer Saleh

    Fixed bug in polymorphic_url([record, :singular]).

    June 20th, 2008 @ 10:38 PM

  7. Repository
    Repository
    • State changed from open to resolved

    (from [0304bb182acaaf73e501a39fbf71d78dd28d0815]) Fixed polymorphic_url to be able to handle singleton resources.

    Example usage:

    polymorphic_url([:admin, @user, :blog, @post]) # => admin_user_blog_post_url(@user, @post)

    [#461 state:resolved]

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 03:08 AM

  8. Repository
    Repository

    (from [bb6e8eea5a8190aaab67da0a7efedb3bb3d9fccb]) Fixed polymorphic_url to be able to handle singleton resources.

    Example usage:

    polymorphic_url([:admin, @user, :blog, @post]) # => admin_user_blog_post_url(@user, @post)

    [#461 state:resolved]

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 03:08 AM