# Link\_to

**URL:** <https://www.ruby-forum.com/t/link-to/137390>\
**Category:** Rails\
**Created:** [May 12, 2008, 7:08pm UTC](https://www.ruby-forum.com/t/link-to/137390 "2008-05-12T19:08:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![biqut2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biqut2](https://www.ruby-forum.com/u/biqut2)\
**Post date:** [May 12, 2008, 7:08pm UTC](https://www.ruby-forum.com/t/link-to/137390/1 "2008-05-12T19:08:25Z")

</div>

I am having trouble with this piece of code. It does not open a popup  
window. If I put curly braces around the controller and action part I  
get a popup but the varible username does not get passed. Can anyone  
help me out, Im running rails 2.0.2.

\<%= link\_to trip.user.username, :controller =\> :page, :action =\>  
:sendmail, :popup =\> [‘Contact User’, ‘height=600,width=800’],  
:username =\> trip.user.username %\>

---

<div class="post-metadata">

**Author:** ![biqut2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biqut2](https://www.ruby-forum.com/u/biqut2)\
**Post date:** [May 12, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/link-to/137390/2 "2008-05-12T19:53:13Z")

</div>

NW, here is the solution.

\<%= link\_to trip.user.username, { :controller =\> :page, :action =\>  
:sendmail, :username =\> trip.user.username }, :popup =\> true %\>

---

<div class="post-metadata">

**Author:** ![biqut2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biqut2](https://www.ruby-forum.com/u/biqut2)\
**Post date:** [May 12, 2008, 7:54pm UTC](https://www.ruby-forum.com/t/link-to/137390/3 "2008-05-12T19:54:18Z")

</div>

or

\<%= link\_to trip.user.username, { :controller =\> :page, :action =\>  
:sendmail, :username =\> trip.user.username }, :popup =\> [‘Contact User’,  
‘height=600,width=800’] %\>
