I have a route
map.connect ‘browse/:languages’, :controller => ‘browse’, :action =>
‘index’
where I expect :languages to be something like ‘en+jp+zh_tw’ so that
I can later do
languages = params[:languages].split(’ ‘)
(because + is an equivalent of a space in a url). But Rails does url-
encode all params, and I get ‘en%2Bjp%2Bzh_tw’.
Of course, I could .split(’%2B’), but the url is getting so ugly!
Is there a method to prevent Rails from url-encoding in this case?
/Damian
On Oct 30, 2550 BE, at 22:05, Damian T. wrote:
I have a route
map.connect ‘browse/:languages’, :controller => ‘browse’, :action =>
‘index’
where I expect :languages to be something like ‘en+jp+zh_tw’ so that
I can later do
languages = params[:languages].split(’ ‘)
(because + is an equivalent of a space in a url). But Rails does url-
encode all params, and I get ‘en%2Bjp%2Bzh_tw’.
Of course, I could .split(’%2B’), but the url is getting so ugly!
Is there a method to prevent Rails from url-encoding in this case?
I got with the problem by joining languages by a space instead of a
plus sign. It then becomes a nice + in a url.
Sorry for disturbance.