[PATCH conductor] Fixes bug relating to provider account routing.

Scott Seago sseago at redhat.com
Thu Aug 16 15:15:07 UTC 2012


Since provider accounts are only accessible via a nested route, link_to(@account)
fails without an explicit provider_account_path method.

This is a short-term hack to make the profile page work again, the real fix
is to remove the nested route for provider accounts, since there's really
no need for it -- just like we don't nest routes for pools, instances, etc.
---
 src/app/helpers/application_helper.rb |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/app/helpers/application_helper.rb b/src/app/helpers/application_helper.rb
index 6ddee96..5569071 100644
--- a/src/app/helpers/application_helper.rb
+++ b/src/app/helpers/application_helper.rb
@@ -167,6 +167,11 @@ module ApplicationHelper
     will_paginate(collection, :previous_label => t('will_paginate.previous_label'), :next_label => t('will_paginate.next_label'))
   end
 
+  # FIXME: remove this once we remove nested routes for provider accounts.
+  def provider_account_path(account)
+    "/providers/#{account.provider_id}/provider_accounts/#{account.id}"
+  end
+
   module_function :count_uptime
 
   class FormBuilderWithRequiredFields < ActionView::Helpers::FormBuilder
-- 
1.7.6.5




More information about the aeolus-devel mailing list