Fix bug 376

This commit is contained in:
Raphael 2010-10-19 11:39:52 -07:00
parent de0b240dbb
commit 9f653e39f1
2 changed files with 9 additions and 1 deletions

View file

@ -7,6 +7,14 @@ module ApplicationHelper
!@aspect.is_a?(Symbol) && @aspect.id == aspect.id !@aspect.is_a?(Symbol) && @aspect.id == aspect.id
end 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 = {}) def object_path(object, opts = {})
object = object.person if object.is_a? User object = object.person if object.is_a? User
eval("#{object.class.to_s.underscore}_path(object, opts)") eval("#{object.class.to_s.underscore}_path(object, opts)")

View file

@ -28,7 +28,7 @@
%br %br
%br %br
%ul %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) %li= link_to t('.photos'), albums_path(:aspect => @aspect)
%br %br