32 lines
701 B
Plaintext

%h1 Listing projects
-# - if policy(Project).new?
= link_to '+ Add New Project', new_project_path
%table
%thead
%tr
%th Title
%th Description
%th Owner
%th
%th
%th
%tbody
- @projects.each do |project|
%tr
%td= link_to project.title, project
%td= project.description
%td= project.user
-# %td= link_to 'Show', project
%td
- if policy(project).edit?
%td= link_to 'Edit', edit_project_path(project)
- else
%td
- if policy(project).destroy?
%td= link_to 'Destroy', project, method: :delete, data: { confirm: 'Are you sure?' }
- else
%td