I am making a rails app, and I have a class that is a link (its inside a tag). I want <%= User.find_by_id(p.user_id).username %>
to be a link to the user, so my questions are:
1) How do I make it a link to the user?
2) When I click on a link that I make, that is inside another link, it activates the outer link. How can I make the click respond the the inner link instead? (in the code under).
<div class="row">
<a class="fg" href="#<%= p.id %>" data-toggle="modal">
<div class="span6 offset3">
<div class="thumbnail">
<table border="0" width="100%" cellpadding="5px">
<tr>
<td>
<%= image_tag(p.thumbnail, class: "hoi") %>
</td>
<td id="tzt2" width="60%">
<div id="withJosefin">
<%= p.title %>
</div>
<div id="withLibre">
by <%= User.find_by_id(p.user_id).username %> <%= time_ago_in_words(p.created_at) %> ago
</div>
</td>
</tr>
</table>
</div>
</div>
</a>
</div>