In my application I'm rendering comment part with each statement but
getting an unusual response in it. An empty comment is always been
there. I'm using Rails 4 with materialize css. This is how looks [1]
like.
Here is my code
<div class="s12 m7 l8 col">
<ul class="collection with-header">
<li class="collection-header">
<h5>Comment's for you</h5>
</li>
<% @student.comments.each do |comment| %>
<li class="collection-item">
<!-- Content in single row -->
<div>
<%= comment.content %>
<% if comment.user_id ==
current_user.id ||
current_user.try(:admin?) %>
<%= link_to [comment.student, comment], method: :delete, class:
"secondary-content" do %>
<i class="material-icons">delete</i>
<% end %>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
[1] :
http://www.awesomescreenshot.com/image/1422159/fbabde9acca44d7813726991a087eb40
--
Cheers!
Deepak Kumar Sharma
Guru Nanak Dev Engineering College
India!
Blog:
http://deekysharma.wordpress.com