summaryrefslogtreecommitdiff
path: root/app/controllers/generic_files_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/generic_files_controller.rb')
-rw-r--r--app/controllers/generic_files_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/generic_files_controller.rb b/app/controllers/generic_files_controller.rb
index b3c0390..ddedbe5 100644
--- a/app/controllers/generic_files_controller.rb
+++ b/app/controllers/generic_files_controller.rb
@@ -11,6 +11,7 @@ class GenericFilesController < ApplicationController
load_and_authorize_resource :generic_file, :through => [:sip_account, :conference, :hunt_group, :automatic_call_distributor, :user, :tenant]
before_filter :set_and_authorize_parent
+ before_filter :spread_breadcrumbs
def index
@generic_files = @parent.generic_files
@@ -69,4 +70,18 @@ class GenericFilesController < ApplicationController
authorize! :read, @parent
end
+
+ def spread_breadcrumbs
+ if @parent.class == User
+ add_breadcrumb t("users.index.page_title"), tenant_users_path(@parent.current_tenant)
+ add_breadcrumb @parent, tenant_user_path(@parent.current_tenant, @parent)
+ end
+
+ add_breadcrumb t("generic_files.index.page_title"), method( :"#{@parent.class.name.underscore}_generic_files_url" ).(@parent)
+
+ if @generic_file
+ add_breadcrumb @generic_file
+ end
+
+ end
end