From d6348188fcd3b694de19f9ebaf53b0bd4f2f6ad2 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Sat, 20 Oct 2007 06:59:52 +0000 Subject: [PATCH] ActionItem85: exclude the exclude button --- app/controllers/profile_admin/enterprise_editor_controller.rb | 7 ++++--- app/helpers/application_helper.rb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/profile_admin/enterprise_editor_controller.rb b/app/controllers/profile_admin/enterprise_editor_controller.rb index 2188408..6936736 100644 --- a/app/controllers/profile_admin/enterprise_editor_controller.rb +++ b/app/controllers/profile_admin/enterprise_editor_controller.rb @@ -30,9 +30,10 @@ class EnterpriseEditorController < ProfileAdminController # Elimitates the enterprise of the system def destroy - if @enterprise.destroy + raise "bli" + if @enterprise.destroy! flash[:notice] = _('Enterprise sucessfully erased from the system') - redirect_to :profile => current_user.login + redirect_to :controller => 'profile_editor', :action => 'index', :profile => current_user.login else redirect_to :action => 'index' end @@ -51,7 +52,7 @@ class EnterpriseEditorController < ProfileAdminController protected def check_enterprise - redirect_to '/' unless @profile.is_a?(Enterprise) + redirect_to :controller => 'profile_editor', :profile => current_user.login unless @profile.is_a?(Enterprise) @enterprise = @profile end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 153296a..641b1a3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -191,7 +191,7 @@ module ApplicationHelper [(link_to_myprofile _('Edit visual design'), {:controller => 'profile_editor', :action => 'design_editor'}, profile.identifier), 'edit_profile_design', profile], [(link_to_myprofile _('Edit informations'), {:controller => 'profile_editor'}, profile.identifier), 'edit_profile', profile], [(link_to_myprofile _('Manage content'), {:controller => 'cms'}, profile.identifier), 'post_content', profile], - [(link_to_myprofile _('Exclude'), {:controller => 'enterprise_editor', :action => 'destroy'}, profile.identifier), 'edit_profile', profile], +# [(link_to_myprofile _('Exclude'), {:controller => 'enterprise_editor', :action => 'destroy'}, profile.identifier), 'edit_profile', profile], ] end -- libgit2 0.21.2