This project is archived and is in readonly mode.

#5291 ✓invalid
Rust/OGAWA

Use default_url_options in polymorphic_url

Reported by Rust/OGAWA | August 4th, 2010 @ 08:06 AM

Although url_for in ActionDispatch::Routing::UrlFor uses default_url_options to make URL, polymorphic_url in ActionDispatch::Routing::PolymorphicRoutes does not use. When I set up default_url_options, the following calls of url_for and new_user_path makes different result.

default_url_options[:ver] = "rails"
url_for(:controller => "users", :action => "index", :id => 1) #=> "/users/1?ver=rails3"
new_user_path #=> "/users/1"

The patch is attached. This is important to jpmobile, de-facto standard Rails plugin for Japanese mobile phone, to use polymorphic_url on mobile phone that can't handle Cookie by setting session_id and session_key to default_url_options.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages