Created
June 8, 2017 09:22
-
-
Save Nursultan91/64b3030a68b833029fcdf9694271e1b3 to your computer and use it in GitHub Desktop.
Страница reviews/_index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @reviews.blank? %> | |
<span class="center"><h4>У этого курса пока нет отзывов</h4></span> | |
<% end %> | |
<% @reviews.order("id desc").each do |r| %> | |
<hr> | |
<div class="row"> | |
<div class="col m1"> | |
<%= image_tag avatar_url(r.user), class: "circle responsive-img avatar-small" %> | |
</div> | |
<div class="col m10"> | |
<div> | |
<strong><%= r.user.name %></strong> | |
<span class="right"><%= timeago(r.created_at) %></span> | |
</div> | |
<div id="stars_<%= r.id %>"></div> | |
<div><%= r.comment %></div> | |
<div> | |
<%= link_to "Удалить", [@project, r], method: :delete, data: {confirm: "Вы уверены?"} if current_user && current_user.id == r.user.id %> | |
</div> | |
</div> | |
</div> | |
<script> | |
$('#stars_<%= r.id %>').raty({ | |
path: '/assets', | |
readOnly: true, | |
score: <%= r.star %> | |
}); | |
</script> | |
<% end %> | |
<script> | |
$(function() { | |
$("time.timeago").timeago(); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment