I have first name and last name in separate fields in my database. I’d like to display them next to each other and have the combined string be the link to the show method.
Right now this is what I have:
<td><%= link_to employee.first, employee_path(employee) %></td>
<td><%= employee.last %></td>
Which displays:
Mark Smith (with the link on Mark)
I’d like it to display as:
Mark Smith (with both words as the hyperlink)
You can do it simply with concatenation: