jnaqsh/nerdnews

View on GitHub
app/views/comments/show.html.erb

Summary

Maintainability
Test Coverage
<% set_meta_tags  title: [t('comments.title'), t('.title')],
                  description: "نمایش دیدگاه #{@comment.name}" %>
<%- model_class = @comment.class -%>
<% content_for :page_header do %>
  <h1><%=t '.title', :default => model_class.model_name.human %></h1>
<% end %>

<dl class="dl-horizontal">
  <dt><strong><%= model_class.human_attribute_name(:name) %>:</strong></dt>
  <dd><%= @comment.name %></dd>
  <dt><strong><%= model_class.human_attribute_name(:content) %>:</strong></dt>
  <dd><%= @comment.content %></dd>
  <dt><strong><%= model_class.human_attribute_name(:story_id) %>:</strong></dt>
  <dd><%= @comment.story_id %></dd>
</dl>

<div class="form-actions">
  <%= link_to t('.back', :default => t("helpers.links.back")),
              story_comments_path, :class => 'btn'  %>
  <%= link_to t('.edit', :default => t("helpers.links.edit")),
              edit_story_comment_path(@comment.story, @comment), :class => 'btn' %>
  <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
              story_comment_path(@comment.story, @comment),
              :method => 'delete',
              :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
              :class => 'btn btn-danger' %>
</div>