# Links to external content

**URL:** <https://www.ruby-forum.com/t/links-to-external-content/176279>\
**Category:** Rails\
**Created:** [September 28, 2009, 2:50pm UTC](https://www.ruby-forum.com/t/links-to-external-content/176279 "2009-09-28T14:50:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 28, 2009, 2:50pm UTC](https://www.ruby-forum.com/t/links-to-external-content/176279/1 "2009-09-28T14:50:20Z")

</div>

Hello everybody.

I have a tricky situation with external links in my Rails application.  
I have online shopping catalog. All goods have “vendor information”  
field where URL to vendor’s information about particular shopping item  
could be found. The problem is that I’m not unable to create external  
links in shopping item views - Rails adds host and controller to the  
vendor’s URL, like this “[http://www.myshoppingcatalog.com/](http://www.myshoppingcatalog.com/)  
shopping\_items/www.vendor.com”. I tried link\_to and url\_for almost all  
variations but it didn’t work. How can I get “pure” vendor’s URL ?

Thank you for your help in advance.

Best regards,  
ArtÅ«rasB.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 28, 2009, 3:13pm UTC](https://www.ruby-forum.com/t/links-to-external-content/176279/2 "2009-09-28T15:13:39Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Hello everybody.
> 
> I have a tricky situation with external links in my Rails application.  
> I have online shopping catalog. All goods have “vendor information”  
> field where URL to vendor’s information about particular shopping item  
> could be found. The problem is that I’m not unable to create external  
> links in shopping item views - Rails adds host and controller to the  
> vendor’s URL, like this “[http://www.myshoppingcatalog.com/](http://www.myshoppingcatalog.com/)  
> shopping\_items/www.vendor.com”. I tried link\_to and url\_for almost all  
> variations but it didn’t work. How can I get “pure” vendor’s URL ?

Use a full URL – in other words, start with “http://”. If you do that,  
link\_to should figure out what you want.

> Thank you for your help in advance.
> 
> Best regards,  
> ArtÅ«rasB.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 29, 2009, 10:05am UTC](https://www.ruby-forum.com/t/links-to-external-content/176279/3 "2009-09-29T10:05:24Z")

</div>

Hi Marnen .

Thank you for the idea. I’ll try it at home.

Regards,  
ArtÅ«ras B.

On 28 Rugs, 16:13, Marnen Laibow-Koser \<rails-mailing-l…@andreas-
