rails/rails — pull request #6375 by senny (2012-05-18 09:35:08+00:00)
Title: remove side effects on :controller option in #url_for

# Bug Description:

If the `:controller` option in an url_for call contains a leading slash it
will be removed, which causes side-effects:

```ruby
my_controller = '/Example'
url_for(:controller => my_controller)
puts my_controller # => 'Example'
```

The side-effects then affect plugins like will_paginate, which store the options to pass to `url_for` in an instance_variable. The functionality then breaks after the first call to `url_for`.

# Resolution:

The route-set does not directly manipulate the string passed into `#url_for`.
It creates a copy without the leading slash if necessary.