# Target iframe from controller action

**URL:** <https://www.ruby-forum.com/t/target-iframe-from-controller-action/117694>\
**Category:** Rails\
**Created:** [October 19, 2007, 2:11pm UTC](https://www.ruby-forum.com/t/target-iframe-from-controller-action/117694 "2007-10-19T14:11:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrcoffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mrcoffe](https://www.ruby-forum.com/u/mrcoffe)\
**Post date:** [October 19, 2007, 2:11pm UTC](https://www.ruby-forum.com/t/target-iframe-from-controller-action/117694/1 "2007-10-19T14:11:53Z")

</div>

have a problem with something i thought should be really easy…

a link is targeted to an iframe in the view:

\<%= link\_to “test”, :controller =\> ‘Say’, :action =\> ‘hey’, :target =\>  
“open\_here” %\>

the problem is that the action just opens in the complete window and not  
int the iframe. have tried with ordinary view and render :partial,  
placed in the controller or in the view but doesnt work either.

could someone please tell me why.

---

<div class="post-metadata">

**Author:** ![mrcoffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mrcoffe](https://www.ruby-forum.com/u/mrcoffe)\
**Post date:** [October 19, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/target-iframe-from-controller-action/117694/2 "2007-10-19T18:00:15Z")

</div>

Johan Balle wrote:

> have a problem with something i thought should be really easy…
> 
> a link is targeted to an iframe in the view:
> 
> \<%= link\_to “test”, :controller =\> ‘Say’, :action =\> ‘hey’, :target =\>  
> “open\_here” %\>
> 
> the problem is that the action just opens in the complete window and not  
> int the iframe. have tried with ordinary view and render :partial,  
> placed in the controller or in the view but doesnt work either.
> 
> could someone please tell me why.

\<%= link\_to “test”, {:controller =\> ‘Say’, :action =\> ‘hey’}, {:target  
=\> “open\_here”} %\>
