This may be a fairly simple question, but my goal here is to redirect to another part of my application and pass parameters confidently.
Right now, I want to pass the :mobile and :content parameters from “/xxx” to “/yyy”.
Parameters come in clean and fine into “/xxx”, but I am currently passing them like so:
redirect_to "/yyy?mobile=#{params[:mobile]}&content=#{params[:content]}"
Despite this working, this seems to have an encoding issue. Spaces come up as “%20” and not “+” for one as well as it seeming generally dirty.
You can use the url_encode method, example :
Or simply use redirect_to with parameters :