summaryrefslogtreecommitdiff
path: root/app/controllers/fax_documents_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-12 13:53:28 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-12 13:53:28 +0100
commitc9066760fd1f5f2f892ce2be5cf2a83bb5210246 (patch)
tree82ecdd528e803ccd1b469dc13482e06cf8ea0b8e /app/controllers/fax_documents_controller.rb
parent0b97717b2171820dea41de8df705f8f0e4b71464 (diff)
parentfb66a5e5a4c5d5f9eac4a5e8de6a286482cb55d5 (diff)
Release a new beta.5.1-beta4
Diffstat (limited to 'app/controllers/fax_documents_controller.rb')
-rw-r--r--app/controllers/fax_documents_controller.rb25
1 files changed, 10 insertions, 15 deletions
diff --git a/app/controllers/fax_documents_controller.rb b/app/controllers/fax_documents_controller.rb
index eff9604..5653683 100644
--- a/app/controllers/fax_documents_controller.rb
+++ b/app/controllers/fax_documents_controller.rb
@@ -58,23 +58,18 @@ class FaxDocumentsController < ApplicationController
end
private
+
def spread_breadcrumbs
- breadcrumbs = []
- breadcrumbs = case @fax_account.fax_accountable.class.to_s
- when 'User' ; [
- [@fax_account.fax_accountable.to_s, user_path(@fax_account.fax_accountable)],
- [t('fax_accounts.name').pluralize, user_fax_accounts_path(@fax_account.fax_accountable)],
- [t('fax_documents.name').pluralize, fax_account_fax_documents_path(@fax_account)],
- ]
- when 'UserGroup' ; [
- [@fax_account.fax_accountable, user_group_path(@fax_account.fax_accountable)],
- [t('fax_accounts.name').pluralize, user_group_fax_accounts_path(@fax_account.fax_accountable)],
- [t('fax_documents.name').pluralize, fax_account_fax_documents_path(@fax_account)],
- ]
+ if @fax_account && @fax_account.fax_accountable.class == User
+ add_breadcrumb t("users.index.page_title"), tenant_users_path(@fax_account.fax_accountable.current_tenant)
+ add_breadcrumb @fax_account.fax_accountable, tenant_user_path(@fax_account.fax_accountable.current_tenant, @fax_account.fax_accountable)
end
- if !breadcrumbs.blank?
- breadcrumbs.each do |breadcrumb|
- add_breadcrumb breadcrumb[0], breadcrumb[1]
+
+ if @fax_account
+ add_breadcrumb t("fax_accounts.index.page_title"), user_fax_accounts_path(@fax_account.fax_accountable)
+ add_breadcrumb @fax_account, user_fax_account_path(@fax_account.fax_accountable, @fax_account)
+ if @fax_document && !@fax_document.new_record?
+ add_breadcrumb @fax_document, fax_account_fax_document_path(@fax_account, @fax_document)
end
end
end