# Passing multiple values with link\_to

**URL:** <https://www.ruby-forum.com/t/passing-multiple-values-with-link-to/166624>\
**Category:** Rails\
**Created:** [April 27, 2009, 11:57pm UTC](https://www.ruby-forum.com/t/passing-multiple-values-with-link-to/166624 "2009-04-27T23:57:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DVG](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/67e7ee/32.png) [@DVG](https://www.ruby-forum.com/u/DVG)\
**Post date:** [April 27, 2009, 11:57pm UTC](https://www.ruby-forum.com/t/passing-multiple-values-with-link-to/166624/1 "2009-04-27T23:57:46Z")

</div>

Okay, so I have a many-to-many relationship between Users and Groups.  
When looking at the Group, I have the user rows being rendered via a  
partial. I want to have a “Remove” link next to each user name in  
turn, which calls the “remove user from group” action, but I’m unsure  
how exactly to specify this with link\_to.

This is what I have:

 \<%= @user.login %\> (\<%= link\_to "Remove", :action =\> "remove\_user\_from\_group", :id =\> @group.id, :locals =\> {:login =\> @user.login} %\>)

---

<div class="post-metadata">

**Author:** ![DVG](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/67e7ee/32.png) [@DVG](https://www.ruby-forum.com/u/DVG)\
**Post date:** [April 28, 2009, 12:00am UTC](https://www.ruby-forum.com/t/passing-multiple-values-with-link-to/166624/2 "2009-04-28T00:00:42Z")

</div>

On Apr 27, 10:57 pm, DVG [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Okay, so I have a many-to-many relationship between Users and Groups.  
> When looking at the Group, I have the user rows being rendered via a  
> partial. I want to have a “Remove” link next to each user name in  
> turn, which calls the “remove user from group” action, but I’m unsure  
> how exactly to specify this with link\_to.

You can pass as many url parmeters to link\_to as you want, eg link\_to  
‘Remove’, :action =\> “remove\_user\_from\_group”, :id =\> @group.id, :foo  
=\> ‘bar’, :baz =\> ‘123’

Fred
