# Link\_to\_remote for external URL

**URL:** <https://www.ruby-forum.com/t/link-to-remote-for-external-url/128067>\
**Category:** Rails\
**Created:** [February 4, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/link-to-remote-for-external-url/128067 "2008-02-04T18:53:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@jackster](https://www.ruby-forum.com/u/jackster)\
**Post date:** [February 4, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/link-to-remote-for-external-url/128067/1 "2008-02-04T18:53:50Z")

</div>

Hi Forum,

I have been using link\_to\_remote for other pages within my Rails  
environment with no problem. Right now I need to add a link to an  
external webpage and can’t seem to get the syntax right.

I’m trying to do something like this:

\<%= link\_to\_remote("Click Here for External Link,  
:update =\> “displaydiv”,  
:url =\> {:action =\> ‘[http://www.ruby-forum.com](http://www.ruby-forum.com)’ }) %\>

any and all help is greatly appreciated

jackster

---

<div class="post-metadata">

**Author:** ![jackster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@jackster](https://www.ruby-forum.com/u/jackster)\
**Post date:** [February 4, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/link-to-remote-for-external-url/128067/2 "2008-02-04T19:44:42Z")

</div>

On 4 Feb 2008, at 17:53, jackster the jackle wrote:

> \<%= link\_to\_remote("Click Here for External Link,  
> :update =\> “displaydiv”,  
> :url =\> {:action =\> ‘[http://www.ruby-forum.com](http://www.ruby-forum.com)’ }) %\>

the same origin policy prohibits you from making ajax calls to domains  
other than the one from which your page originated.  
There are some clever tricks you can play to get round this (eg  
[IBM Developer](http://www.ibm.com/developerworks/library/x-ajaxsecurity.html))

Fred
