From 9f653e39f135dfa68295e60b57f33c2c58a3c080 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 19 Oct 2010 11:39:52 -0700 Subject: [PATCH] Fix bug 376 --- app/helpers/application_helper.rb | 8 ++++++++ app/views/shared/_aspect_friends.haml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e6fadfef3..830fe2dff 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,6 +7,14 @@ module ApplicationHelper !@aspect.is_a?(Symbol) && @aspect.id == aspect.id end + def aspect_or_all_path aspect + if @aspect.is_a? Aspect + aspect_path @aspect + else + aspects_path + end + end + def object_path(object, opts = {}) object = object.person if object.is_a? User eval("#{object.class.to_s.underscore}_path(object, opts)") diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 876da05e7..e185dc306 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -28,7 +28,7 @@ %br %br %ul - %li= link_to 'stream', aspect_path(@aspect) + %li= link_to 'stream', aspect_or_all_path(@aspect) %li= link_to t('.photos'), albums_path(:aspect => @aspect) %br