Lauchix
Lauchix

Reputation: 45

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? By the way I want the name from the company shown at this view.

Upvotes: 0

Views: 1806

Answers (1)

Nadiya
Nadiya

Reputation: 1527

Just use link_to:

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

Upvotes: 1

Related Questions