devblog/app/views/comments/index.html.erb

47 lines
1.9 KiB
Plaintext

<%- model_class = Comment -%>
<div class="page-header">
<h1><%=t '.title', :default => model_class.model_name.human.pluralize.titleize %></h1>
</div>
<table class="table table-striped">
<thead>
<tr>
<th><%= model_class.human_attribute_name(:id) %></th>
<th><%= model_class.human_attribute_name(:article_id) %></th>
<th><%= model_class.human_attribute_name(:title) %></th>
<th><%= model_class.human_attribute_name(:content) %></th>
<th><%= model_class.human_attribute_name(:rate) %></th>
<th><%= model_class.human_attribute_name(:created_by) %></th>
<th><%= model_class.human_attribute_name(:updated_by) %></th>
<th><%= model_class.human_attribute_name(:created_at) %></th>
<th><%=t '.actions', :default => t("helpers.actions") %></th>
</tr>
</thead>
<tbody>
<% @comments.each do |comment| %>
<tr>
<td><%= link_to comment.id, comment_path(comment) %></td>
<td><%= comment.article_id %></td>
<td><%= comment.title %></td>
<td><%= comment.content %></td>
<td><%= comment.rate %></td>
<td><%= comment.created_by %></td>
<td><%= comment.updated_by %></td>
<td><%=l comment.created_at %></td>
<td>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
edit_comment_path(comment), :class => 'btn btn-default btn-xs' %>
<%= link_to t('.destroy', :default => t("helpers.links.destroy")),
comment_path(comment),
:method => :delete,
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
:class => 'btn btn-xs btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to t('.new', :default => t("helpers.links.new")),
new_comment_path,
:class => 'btn btn-primary' %>