Re: Re: Advanced routing question.

Jim Jeffers
2005-12-15T02:52:52Z

Thanks a lot Eero!

----------------------------------------
Jim Jeffers
"A trustworthy individual."
www.DontTrustThisGuy.com
(480) 235-5201

On Dec 14, 2005, at 1:45 PM, Eero Saynatkari wrote:

> Jim Jeffers wrote:
>> Hello All,
>>
>> I''m making a quick application that tracks outgoing links to
referral
>> sites.  I need to track the user and the url they went to so the
>> easiest way would be to take the entire url as a parameter and log
>> that into the database.  I was wondering if I could do something like
>> this with routing:
>>
>> http://www.example.com/user/jump/http://www.myvendor.com/
>> referral.php?
>> id=23ijo23jnjknbdc&uid=32lknklfelkj32
>>
>> user => controller
>> jump => action
>> http://www.myvendor.com/referral.php?
>> id=23ijo23jnjknbdc&uid=32lknklfelkj32 => string/parameter
>>
>> I don''t know it''s possible to do this because the url
itself contains
>> ''/''.  Any ideas?
>
> You should be able to use the ''generic URL'' form of
routing:
>
>   map.connect ''user/jump/*path'', # ...
>
> This way, params[:path] will have the path information.
>
> You will almost certainly want to URI.encode(url_string)
> when generating the links and it might not be a bad idea
> to Base64-encode it as well, just to avoid any problems:
>
>   require ''base64''
>
>   url = Base64.decode64(Base64.encode64(url))
>
>
> E
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>



_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org