Lauchix Lauchix - 4 months ago 18
Ruby Question

Clickable Link_to Table in Rails

is there any way to do a clickable td ?

<% @companies.each do |c| %>
<tbody>
<tr>
<td><%= c.name %></td>...


Now I want to click on the name from the company and see another view(an overview from that company).
Is there a way with link_to or something else?
And btw I want the name from the company shown at this view

Thanks!

Answer

Just use link_to:

<td><%= link_to c.name, some_path %></td>