ruby on rails - Path helper inserts plus sign instead of space -


i want have link_to with

<%= link_to "my link", search_path(par: "my link") %> 

but gets rendered

<a href="/search?par=my+link">my link</a> 

instead of

<a href="/search?par=my link">my link</a> 

is there way force behave properly, , not manually insert %20 instead of space?

try this

require 'cgi' cgi.unescape "/search?par=my+link" 

example:

1.9.3p448 :006 > cgi.unescape "/search?par=my+link"  => "/search?par=my link"   1.9.3p448 :007 > cgi.unescape "/search?par=my%20link"  => "/search?par=my link" 

hope helps!


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -