From d3d3a4a25bd7ac1a2d757496abfca4f248d1df7d Mon Sep 17 00:00:00 2001 From: Oliver Kraitschy Date: Wed, 19 Jul 2017 14:55:00 +0200 Subject: [PATCH] Fix Edit and Destroy links for objects --- app/views/objects/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/objects/index.html.erb b/app/views/objects/index.html.erb index 35f6291..09a6aa5 100644 --- a/app/views/objects/index.html.erb +++ b/app/views/objects/index.html.erb @@ -16,8 +16,8 @@ content_for :title do 'Object List' end <% @objects.each do |object| %> <%= object['_id'] %> - <%= link_to 'Edit', "/objects/#{object['_id']}/edit" if can?(:update, 'objects') %> - <%= link_to 'Destroy', "/objects/#{object['_id']}", method: :delete, data: { confirm: 'Are you sure?' } if can?(:delete, 'objects') %> + <%= link_to 'Edit', {controller: 'objects', action: 'edit', id: object['_id']} if can?(:update, 'objects') %> + <%= link_to 'Destroy', {controller: 'objects', action: 'destroy', id: object['_id']}, method: :delete, data: { confirm: 'Are you sure?' } if can?(:delete, 'objects') %> <% end %>