# Assigning Show method to a field on Index/list views

**URL:** <https://www.ruby-forum.com/t/assigning-show-method-to-a-field-on-index-list-views/133936>\
**Category:** Rails\
**Created:** [April 5, 2008, 6:31am UTC](https://www.ruby-forum.com/t/assigning-show-method-to-a-field-on-index-list-views/133936 "2008-04-05T06:31:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colleen\_RobledoS\_ML](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea5d25/32.png) [@Colleen\_RobledoS\_ML](https://www.ruby-forum.com/u/Colleen_RobledoS_ML)\
**Post date:** [April 5, 2008, 6:31am UTC](https://www.ruby-forum.com/t/assigning-show-method-to-a-field-on-index-list-views/133936/1 "2008-04-05T06:31:03Z")

</div>

Hello,

I’m still very new to learning Rails (I’m better with Grails).

On the Index/List views, how can I assign he Show method to a field  
in the table(making that particular table field the “clickable” link  
to the associated Show view) , rather than display the link\_to Show  
view as a separate text link?

I know it’s something I have to set in the

 tag for that field:  
\<%=h table.field\_name %\>  
But I’m not quite sure how…

Thank you!

Colleen Robledo

---

<div class="post-metadata">

**Author:** ![Colleen\_RobledoS\_ML](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea5d25/32.png) [@Colleen\_RobledoS\_ML](https://www.ruby-forum.com/u/Colleen_RobledoS_ML)\
**Post date:** [April 5, 2008, 2:52pm UTC](https://www.ruby-forum.com/t/assigning-show-method-to-a-field-on-index-list-views/133936/2 "2008-04-05T14:52:58Z")

</div>

Try \<%= link\_to object.field\_name, :action =\> ‘show’, :id =\> object.id  
%\>.

That should give you the field text as the link to the show action for  
that object.

-Kyle

On Apr 4, 11:30 pm, “Colleen Robledo, MLIS” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Colleen\_RobledoS\_ML](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea5d25/32.png) [@Colleen\_RobledoS\_ML](https://www.ruby-forum.com/u/Colleen_RobledoS_ML)\
**Post date:** [April 5, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/assigning-show-method-to-a-field-on-index-list-views/133936/3 "2008-04-05T18:31:05Z")

</div>

Thanks so much! It worked!
