From e35b15c8682ebb9d37e00128a3c05044164eeb70 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Mar 2016 21:02:54 +1030 Subject: [PATCH] Only render an edit control if the permission exists --- app/views/scientific_names/show.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/scientific_names/show.html.haml b/app/views/scientific_names/show.html.haml index 1c0a76357..dffbdffc3 100644 --- a/app/views/scientific_names/show.html.haml +++ b/app/views/scientific_names/show.html.haml @@ -9,6 +9,8 @@ %b Crop: = link_to @scientific_name.crop, @scientific_name.crop -= link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-default btn-xs' -\| + +- if can? :edit, @scientific_name + = link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-default btn-xs' + \| = link_to 'Back', scientific_names_path