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.

Route optimisation adds hanging question mark when passed empty options hash

#481

From a view, when calling something like

widget_path(5, {})

you get

/widgets/5?

but I want

/widgets/5

Attached is a patch that fixes the problem, but I haven't been able to figure out how to write a test for it. The test in the patch doesn't actually test the optimisation code -- it just verifies that the unoptimized version does not add the question mark.

Reported by Luke Melia · June 25th, 2008 @ 04:05 AM

State: committed
Milestone: none
Assigned to: Michael Koziarski Michael Koziarski
Importance: none

Activity

  1. Pratik
    Pratik
    • Tag set to actionpack, bug, edge, patch
    • Assigned user set to Michael Koziarski

    June 27th, 2008 @ 01:53 PM

  2. Repository
    Repository
    • State changed from new to committed

    (from [7ce03db77884e21256ba8f1615ad8dd841b76b86]) Fixes optimised named routes generating question mark followed by nothing when provided an empty hash as the last argument.

    Signed-off-by: Michael Koziarski michael@koziarski.com [#481 Route optimisation adds hanging question mark when passed empty options hash state:committed] http://github.com/rails/rails/co...

    August 31st, 2008 @ 06:42 PM