[Rails] Re: routes question [Catching URL in a variable]

softwareengineer 99 softwareengineer99 at yahoo.com
Tue Feb 14 20:49:08 GMT 2006


Thanks for the reply. The URL is legal, see:
  http://technorati.com/search/http://www.google.com
  
  The funny thing is when I encode the URL, Apache doesn't pass the  request to dispatcher.fcgi. For unencoded URLs the request gets passed  perfectly and the only issue is how to determine the number of slashed  (nearly impossible).
  
  So it means we cannot tell Rails via routes.rb that to catch everything  after a certain string in a variable,  unles its encoded.
  
  Thank you very much for your replies.
  
  Frank

Alan Francis <alancfrancis at gmail.com> wrote:  Possibly unrelated, but that URLs probably not legal.   The secondary 
url needs to be encoded.

A.

softwareengineer 99 wrote:
> Hello Rails Gurus,
> 
>   I have spent the entire night trying to figure this out with no luck. 
> I will really appreciate if someone can come to my rescue.
> 
>   I have a URL like the following:
> 
>   http://domain.com/resource/http://www.rubyonrails.org
> 
>   and would like to capture the rubyonrails URL after the 
> http://domain.com/resource/ part in a variable.
> 
>   I tried something like
> 
>   map.connect 'resource/:protocol//:link' ....
> 
>   but since I cannot accurately predict the number of forward slashes 
> involved, I cannot hard code the route.
> 
>   Is there any way I can tell in routes.rb  to capture everything after 
> "resource/" part and store it in a variable?
> 
>   I highly appreciate your assistance.
> 
>   Frank


-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails mailing list
Rails at lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails


		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060214/fccec270/attachment.html


More information about the Rails mailing list