Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10292 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] Named routes _path/_url helpers doesn't recognize option :anchor when called with positional parameters and routing optimisation is used.

Reported by: pager Assigned to: core
Priority: normal Milestone: 2.0
Component: ActionPack Version: edge
Severity: normal Keywords: routing, routing optimisation, bug
Cc:

Description

ActionController::Routing::PositionalArgumentsWithAdditionalParams takes last argument of _path/_url helper as query hash. This is incorrect if that hash has key :anchor. For example:

map.resources :users
user_path(5, :anchor => 'location') 
=> "/users/5?anchor=location" 
# incorrect. should be same as:
user_path(:id => 5, :anchor => 'location')
=> "/users/5#location"

Attachments

named_routes_helpers_doesnt_recognize_anchor_option_fix.patch (2.9 kB) - added by pager on 11/26/07 22:47:20.

Change History

11/26/07 22:47:20 changed by pager

  • attachment named_routes_helpers_doesnt_recognize_anchor_option_fix.patch added.

11/28/07 04:11:40 changed by nzkoz

  • status changed from new to closed.
  • resolution set to fixed.

(In [8227]) Make sure the optimisation code for routes doesn't get used if :host, :anchor or :port are provided in the hash arguments. [pager, Koz] Closes #10292