<%= @user.name %>

<%= mail_to(@user.email) %>

<% if current_user?(@user) %> <%= link_to "Edit Account", edit_user_path(@user), class: "button edit" %> <%= link_to "Delete Account", user_path(@user), class: "button delete", data: { turbo_method: :delete, turbo_confirm: "Permanently delete your account!?" } %> <% end %>
<% if @reviews.present? %>

Reviews

<% @reviews.each do |review| %>
<%= link_to review.movie.title, review.movie %> <%= pluralize(review.stars, 'star') %> <%= time_ago_in_words(review.created_at) %> ago

<%= review.comment %>

<% end %> <% end %> <% if @favorite_movies.present? %>

Favorite Movies

<% @favorite_movies.each do |movie| %> <%= link_to image_tag(movie.image_file_name), movie %> <% end %>
<% end %>