You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
951 B

<section class="user">
<h1><%= @user.name %></h1>
<h2><%= mail_to(@user.email) %></h2>
<div class="actions">
<% 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 %>
</div>
<% if @reviews.present? %>
<h3>Reviews</h3>
<% @reviews.each do |review| %>
<div class="review">
<div class="details">
<span class="title">
<%= link_to review.movie.title, review.movie %>
</span>
<%= pluralize(review.stars, 'star') %>
<span class="date">
<%= time_ago_in_words(review.created_at) %> ago
</span>
<p>
<%= review.comment %>
</p>
</div>
</div>
<% end %>
<% end %>
</section>