techvision/brails4

View on GitHub
app/views/admin/attempts/index.html.haml

Summary

Maintainability
Test Coverage
- model_class = Attempt
.page-header
  %h1=t '.title', :default => model_class.model_name.human.pluralize.titleize
%table.table.table-striped
  %thead
    %tr
      %th= model_class.human_attribute_name(:id)
      %th= model_class.human_attribute_name(:count)
      %th= model_class.human_attribute_name(:solved)
      %th= model_class.human_attribute_name(:points)
      %th= model_class.human_attribute_name(:profile_id)
      %th= model_class.human_attribute_name(:question_id)
      %th= model_class.human_attribute_name(:created_at)
      %th=t '.actions', :default => t("helpers.actions")
  %tbody
    - @attempts.each do |attempt|
      %tr
        %td= link_to attempt.id, admin_attempt_path(attempt)
        %td= attempt.count
        %td= attempt.solved
        %td= attempt.points
        %td= attempt.profile_id
        %td= attempt.question_id
        %td=l attempt.created_at
        %td
          = link_to t('.edit', :default => t("helpers.links.edit")), edit_admin_attempt_path(attempt), :class => 'btn btn-mini'
          = link_to t('.destroy', :default => t("helpers.links.destroy")), admin_attempt_path(attempt), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger'