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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Damian Terentiev
2007-Oct-30 22:31 UTC
Re: [SOLVED] How to prevent Rails from url-encoding
On Oct 30, 2550 BE, at 22:05, Damian Terentiev 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---