diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/voicemail_accounts_controller.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/voicemail_accounts_controller.rb b/app/controllers/voicemail_accounts_controller.rb index 0bfa160..2e96cb7 100644 --- a/app/controllers/voicemail_accounts_controller.rb +++ b/app/controllers/voicemail_accounts_controller.rb @@ -10,6 +10,7 @@ class VoicemailAccountsController < ApplicationController load_and_authorize_resource :phone_number, :through => [:sip_account, :conference, :hunt_group, :automatic_call_distributor, :user, :tenant] before_filter :set_and_authorize_parent + before_filter :spread_breadcrumbs def index @voicemail_accounts = @parent.voicemail_accounts @@ -75,4 +76,17 @@ class VoicemailAccountsController < 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("voicemail_accounts.index.page_title"), method( :"#{@parent.class.name.underscore}_voicemail_accounts_url" ).(@parent) + + if !@voicemail_account.to_s.blank? + add_breadcrumb @voicemail_account.name + end + end + end |