diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index d5ba9c9..0c89963 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -65,12 +65,10 @@ # DELETE /dmptemplates/1 def admin_destroy - @dmptemplate = Dmptemplate.find(params[:id]) - authorize @dmptemplate - @dmptemplate.destroy - respond_to do |format| - format.html { redirect_to admin_index_dmptemplate_path } - end + @template = Template.find(params[:id]) + authorize @template + @template.destroy + redirect_to admin_index_dmptemplate_path end diff --git a/app/views/templates/_show_template.html.erb b/app/views/templates/_show_template.html.erb index 5763d33..cd60ea3 100644 --- a/app/views/templates/_show_template.html.erb +++ b/app/views/templates/_show_template.html.erb @@ -25,7 +25,7 @@ <%= t('org_admin.templates.published_label') %> - <% if template.published || template.has_published_versions? then%> + <% if template.published then%> <%= template.published %> <% else %> <%= t('org_admin.templates.cannot_publish')%>