  <%if @user.avatar%>
    <%= image_tag @user.avatar %>
  <% end %>
</br>
<p>
  <strong>State:</strong>
  <%= @user.state %>
</p>

<p>
  <strong>Average Rating:</strong>
  <% if @ratings.average(:rating) == nil %>
    <%= "This user has not yet been rated." %>
  <% else %>
    <%= @ratings.average(:rating).round(2) %>
  <% end %>
  <p class="blog-post-meta"><%= link_to "Detailed reviews", "/users/#{@user.id}/feedback" %></p>
</p>


<h4>Past events</h4>

<% @user.events.each do |event| %>
  <% if event.time_start.past? %>
    <strong><%= link_to "#{event.name}", event_path(event.id) %></strong>
    </br>
  <% end %>
<% end %>
  <%if @user.avatar%>
    <%= image_tag @user.avatar %>
  <% end %>
</br>

<p>
  <strong>Average Rating:</strong>
  <% if @ratings.average(:rating) == nil %>
    <%= "This user has not yet been rated." %>
  <% else %>
    <%= @ratings.average(:rating).round(2) %>
  <% end %>
  <p class="blog-post-meta"><%= link_to "Detailed reviews", "/users/#{@user.id}/feedback" %></p>
</p>


<h4>Past events</h4>

<% @user.events.each do |event| %>
  <% if event.time_start.past? %>
    <strong><%= link_to "#{event.name}", event_path(event.id) %></strong>
    </br>
  <% end %>
<% end %>
Remove state from public profile
Remove state from public profile
