app/views/guts/contents/index.html.erb in guts-2.1.0 vs app/views/guts/contents/index.html.erb in guts-3.0.0

- old
+ new

@@ -1,9 +1,9 @@ <div class="row"> <div class="small-12 columns"> <h1><%= @type.title.pluralize 2 %></h1> - <%= link_to("New #{@type.title}", new_content_path(type: @type.slug), class: 'button') if can? :create, Guts::Content %> + <%= link_to("New #{@type.title}", new_content_path(type: @type.slug), class: 'button') if policy([:guts, :content]).new? %> </div> </div> <% if notice %> <div class="row"> @@ -24,11 +24,11 @@ <tr> <td><%= content.title %><% if content.visible == 0 %>&nbsp;&nbsp;<i class="fa fa-eye-slash"></i><% end %></td> <td><small>Created on <%= content.created_at.strftime("%b #{content.created_at.day.ordinalize}, %Y") %></small></td> <td><small>Updated at <%= content.updated_at.strftime("%b #{content.updated_at.day.ordinalize}, %Y") %></small></td> <td align="right" class="action_links"> - <%= link_to('Edit', edit_content_path(content)) if can? :update, Guts::Content %> - <%= link_to_destroy('Destroy', content) if can? :delete, Guts::Content %> + <%= link_to('Edit', edit_content_path(content)) if policy([:guts, :content]).edit? %> + <%= link_to_destroy('Destroy', content) if policy([:guts, :content]).destroy? %> </td> </tr> <% end %> </tbody> </table>