# Is there a way to have link\_to\_remote execute two actions?

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-have-link-to-remote-execute-two-actions/162709>\
**Category:** Rails\
**Created:** [March 12, 2009, 11:23pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-have-link-to-remote-execute-two-actions/162709 "2009-03-12T23:23:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@davidf](https://www.ruby-forum.com/u/davidf)\
**Post date:** [March 12, 2009, 11:23pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-have-link-to-remote-execute-two-actions/162709/1 "2009-03-12T23:23:01Z")

</div>

I’d like users to click on a link with modifies the current page and  
opens a new external url in a new window. I’ve got the link\_to\_remote  
working fine and the current page is updated. But how to I open a url  
in a new window?

---

<div class="post-metadata">

**Author:** ![davidf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@davidf](https://www.ruby-forum.com/u/davidf)\
**Post date:** [March 12, 2009, 11:36pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-have-link-to-remote-execute-two-actions/162709/2 "2009-03-12T23:36:31Z")

</div>

On Mar 12, 8:41 pm, DPF [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’d like users to click on a link with modifies the current page and  
> opens a new external url in a new window. I’ve got the link\_to\_remote  
> working fine and the current page is updated. But how to I open a url  
> in a new window?

in a nutshell this is what rjs / rendering javascript is for.

Fred
