diff --git a/app/helpers/recipes_helper.rb b/app/helpers/recipes_helper.rb index 7ef181b..74d231b 100644 --- a/app/helpers/recipes_helper.rb +++ b/app/helpers/recipes_helper.rb @@ -1,9 +1,15 @@ module RecipesHelper - def is_owner? - if current_user.id == @recipe.user_id then - return true - else - return false - end + def is_owner? + if current_user.id == @recipe.user_id then + return true + else + return false end + end + + def displayGravator?(user) + link_to gravatar_for(user, size: 100), user_path(user) unless user.nil? + + end + end \ No newline at end of file diff --git a/app/views/recipes/_gravatar_section.html.erb b/app/views/recipes/_gravatar_section.html.erb index 4971b94..6913a0e 100644 --- a/app/views/recipes/_gravatar_section.html.erb +++ b/app/views/recipes/_gravatar_section.html.erb @@ -1,2 +1,2 @@ -<%= link_to gravatar_for(user, size: 100), user_path(user) %> +<%= displayGravator?(user) %>
Styles: <%= render @recipe.styles %>
@@ -65,13 +66,20 @@ <%= render partial: 'gravatar_section', locals: {user: @user} %><%= c.body %>
<%= c.updated_at.strftime("%m/%d/%Y") %> <%if c.user == current_user %> <%= link_to "Delete", review_recipe_path(:revid => c.id), class:"btn btn-danger btn-small pull-right", method: :delete, data: { confirm: "Are you sure you want to delete this review?" } %> <%end %> -<%= c.body %>
<%= c.updated_at.strftime("%m/%d/%Y") %> + <%if c.user == current_user %> + <%= link_to "Delete", review_recipe_path(:revid => c.id), class:"btn btn-danger btn-small pull-right", method: :delete, data: { confirm: "Are you sure you want to delete this review?" } %> + <%end %> +