Assigning Show method to a field on Index/list views


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

Try <%= link_to object.field_name, :action => ‘show’, :id =>

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


On Apr 4, 11:30 pm, “Colleen Robledo, MLIS” [email protected]

Thanks so much! It worked!