Skip to content

Commit

Permalink
Do not show bio and location if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
lujanfernaud committed May 17, 2018
1 parent 9f97c43 commit 70d9984
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def titleize_location
end

def capitalize_bio
return unless bio
return unless bio && !bio.empty?

self.bio = bio[0].capitalize + bio[1..-1]
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
</div>

<% if @user.location %>
<% if @user.location && !@user.location.empty? %>
<div class="row">
<div class="col-md-12 mt-4">
<h3 class="h4 profile-heading">Location</h3>
Expand All @@ -43,7 +43,7 @@
</div>
<% end %>

<% if @user.bio %>
<% if @user.bio && !@user.bio.empty? %>
<div class="row">
<div class="col-md-12 mt-4">
<h3 class="h4 profile-heading">Bio</h3>
Expand Down

0 comments on commit 70d9984

Please sign in to comment.