Phil Darnowsky
2009-Oct-07 19:19 UTC
[PATCH] ActionView#url_for shouldn''t escape URLs by default
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2076-rails-should-use-amp-instead-of-in-the-urls#ticket-2076-3 ActionView#url_for generates escaped URLs by default, whereas ActionController#url_for doesn''t. They should be consistent, and I believe that ActionController''s behavior is correct here. The escaping is most noticeable in a call with multiple query parameters: view.url_for(:controller => :foos, :action => :do_stuff, :this => 123, :that => 456) generates http://example.com/foos/do_stuff?that=456&this=123 Note the escaped ampersand in between this and that. Named route helpers use url_for and are thus also affected. --Phil l
Phil Darnowsky
2009-Oct-07 20:26 UTC
Re: ActionView#url_for shouldn''t escape URLs by default
And in case it wasn''t obvious, that link is to a patch for this. On Oct 7, 3:19 pm, Phil Darnowsky <pdarn...@yahoo.com> wrote:> https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2... > > ActionView#url_for generates escaped URLs by default, whereas > ActionController#url_for doesn''t. They should be consistent, and I > believe that ActionController''s behavior is correct here. The > escaping is most noticeable in a call with multiple query parameters: > > view.url_for(:controller => :foos, :action => :do_stuff, :this => > 123, :that => 456) > > generates > > http://example.com/foos/do_stuff?that=456&this=123 > > Note the escaped ampersand in between this and that. Named route > helpers use url_for and are thus also affected. > > --Phil