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