Skip to content

Commit

Permalink
Only showing location and bio if they have it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Apr 5, 2009
1 parent 950021c commit deab790
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
</p>

<dl class="details">
<dt>location</dt>
<dd><%=h @user.location %></dd>
<dt>bio</dt>
<dd><%= auto_link h(@user.description) %></dd>
<%- unless @user.location.blank? -%>
<dt>location</dt>
<dd><%=h @user.location %></dd>
<%- end -%>
<%- unless @user.description.blank? -%>
<dt>bio</dt>
<dd><%= auto_link h(@user.description) %></dd>
<%- end -%>
<%- unless @user.url.blank? -%>
<dt>url</dt>
<dd><%= link_to @user.url, @user.url %></dd>
<%- end -%>

<dt>signup date</dt>
<dd><%= pretty_datetime Time.parse(@user.created_at) %></dd>
</dl>
Expand Down

0 comments on commit deab790

Please sign in to comment.