How to catch a parameter that contains a full url

Hi
I need some help!

I have controller that I need to pass a full url (with its own
parametrs) as a parameter, e.g. I want to call my controller with:

/mycontroller/catchurl?url=somedomain.com

and in action “catchurl” in mycontroller.rb I would like to have
params[:url] to be
somedomain.com

I guess that one could do something smart with map.connect
but so far I have failed completely.

Is there anyone that can give me some help?

whats the problem? params[:url] should work, do you not want to use it
that
way ?

The problem is that the url parameter gets split up into several
parameters, i.e.
params[:url] is somedomain.com
and
params[:param2] is yy

What I want is to treat the whole url as one entity, I do not want it
to be slit up into separate parameters.

On 9/15/06, jonbjo [email protected] wrote:

and in action “catchurl” in mycontroller.rb I would like to have
params[:url] to be
somedomain.com

I guess that one could do something smart with map.connect
but so far I have failed completely.

Is there anyone that can give me some help?

The problem is that the url given above is not valid - ? and & need to
be
escaped in
the parameter value. Browsers do this automatically behind the scenes,
and
then
Rails transforms the parameters back. It seems unclear why you’re having
this
problem - url_for automatically handles the encoding, and so do forms.

Hope this helps,


Matt J.
[email protected]
President/Technical Director, Acme Art Company (acmeartco.org)