# Link\_to to pass an entire row of a table rather than by id

**URL:** <https://www.ruby-forum.com/t/link-to-to-pass-an-entire-row-of-a-table-rather-than-by-id/127129>\
**Category:** Rails\
**Created:** [January 25, 2008, 7:09am UTC](https://www.ruby-forum.com/t/link-to-to-pass-an-entire-row-of-a-table-rather-than-by-id/127129 "2008-01-25T07:09:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 25, 2008, 7:09am UTC](https://www.ruby-forum.com/t/link-to-to-pass-an-entire-row-of-a-table-rather-than-by-id/127129/1 "2008-01-25T07:09:21Z")

</div>

Hi

```
 How can i use link_to in form to pass an already fetched row of a

```

table to an action.I can pass it by :id…But in action i have to again  
use the find method to get the rows again

in show.rhtml I have

\<%= link\_to ‘Edit Resolution’, :controller =\> ‘service\_desk’,:action =\>  
‘define\_sd\_resolution\_ui’, :id =\> @sd\_ticket %\>

Here @sd\_ticket contains title ,owner etc…Which i can print in the  
show.rhtml like

@sd\_ticket.title  
@sd\_ticket.owner

How can I pass the entire @sd\_ticket to action define\_sd\_resolution\_ui  
?(rather by using :id)…If I use the above link to then again i have to  
get data using find  
again  
Pls help  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 25, 2008, 7:38am UTC](https://www.ruby-forum.com/t/link-to-to-pass-an-entire-row-of-a-table-rather-than-by-id/127129/2 "2008-01-25T07:38:38Z")

</div>

you could include all the attributes in your route,  
you could put it in the session,

At the end of the day your best option is to call ‘find’ again like you  
are now.
